home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / FDSG211.ZIP / FDSRC211.ZIP / FDSTAT.BAS next >
Encoding:
BASIC Source File  |  1996-03-25  |  86.5 KB  |  2,050 lines

  1. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  2. 'FrontDoor Statistics Generator              Copyright (C) 1996 Scott Hall   '
  3. '-------------------------------------------------------------------------   '
  4. 'This program is Copyright (C) 1996 Scott Hall. I grant permission for any   '
  5. 'person or company to use any of this program of portions thereof for any    '
  6. 'purpose EXCEPT WHERE the subsequent product:                                '
  7. '                                                                            '
  8. ' a) is not available to the public free of charge.                          '
  9. ' b) is called "FrontDoor Statistics Generator" or "FDSTAT"                  '
  10. '                                                                            '
  11. 'If you use this program, or portions thereof, you accept the above condions.'                                                         '
  12. '                                                                            '
  13. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  14. DECLARE SUB PressEnter (Pause AS INTEGER, Beeps AS INTEGER)
  15. DECLARE SUB ASCIItoASL (X%)
  16. DECLARE FUNCTION AnsiColor$ (Attr AS INTEGER)
  17. DECLARE SUB SaveAscScrn (FileNum AS INTEGER, Title AS INTEGER)
  18. DECLARE SUB SaveAslScrn (FileNum AS INTEGER)
  19. DECLARE SUB SaveAnsiScrn (FileNum AS INTEGER)
  20. DECLARE SUB BBSScreens (FDStatOut AS INTEGER, BBS AS STRING, Node AS STRING)
  21. DECLARE SUB DrawScreen (VERSION$)
  22. Copyright1$ = "FrontDoor Statistics Generator Copyright (C) Scott Hall 1996"
  23. Copyright2$ = "FDStat Copyright (C) Scott Hall 1996"
  24.  
  25. '*********************************************************************
  26. '*******************  DON'T FORGET TO TURN ON  ***********************
  27. '*******************     "ON ERROR..."         ***********************
  28. '*********************************************************************
  29. ON ERROR GOTO ErrorProc
  30.  
  31. '---------------------------------------------------------------------
  32. CONST VERSION$ = "2.11"
  33. '---------------------------------------------------------------------
  34. DIM Pause AS INTEGER
  35. DIM Beeps AS INTEGER
  36. DIM BBS AS STRING
  37. DIM Node AS STRING
  38. DIM FDStatOut AS INTEGER
  39.  
  40. ' Detect present screen colors
  41. CLS
  42. DosAttr = SCREEN(CSRLIN, POS(0), 1)
  43. DosForeClr = (DosAttr AND &H7)
  44. DosBackClr = (DosAttr AND &H70) / 16
  45.  
  46. ' Declare symbolic constants used in program:
  47.  
  48. FieldsFore = 2
  49. FieldsBack = 0
  50. CONST DATEFORE = 14
  51. CONST DATEBACK = 0
  52. CONST FALSE = 0, True = NOT FALSE
  53. Beeps = 1  'Default BEEP On
  54. Pause = 1  'Default PAUSE On
  55.  
  56. '--------------------------------------------------------------------------
  57. '                           Australian Date Format
  58. '--------------------------------------------------------------------------
  59. D$ = MID$(DATE$, 4, 2)
  60. M$ = MID$(DATE$, 1, 2)
  61. Y$ = MID$(DATE$, 7, 4)
  62. IF M$ = "01" THEN M$ = "Jan"
  63. IF M$ = "02" THEN M$ = "Feb"
  64. IF M$ = "03" THEN M$ = "Mar"
  65. IF M$ = "04" THEN M$ = "Apr"
  66. IF M$ = "05" THEN M$ = "May"
  67. IF M$ = "06" THEN M$ = "Jun"
  68. IF M$ = "07" THEN M$ = "Jul"
  69. IF M$ = "08" THEN M$ = "Aug"
  70. IF M$ = "09" THEN M$ = "Sep"
  71. IF M$ = "10" THEN M$ = "Oct"
  72. IF M$ = "11" THEN M$ = "Nov"
  73. IF M$ = "12" THEN M$ = "Dec"
  74. ADATE$ = D$ + "-" + M$ + "-" + Y$
  75.  
  76. '--------------------------------------------------------------------------
  77. '                              Get FDStat Switches
  78. '--------------------------------------------------------------------------
  79. DIM Switch$(5)
  80.  
  81. Log$ = "FD.LOG"
  82. IF COMMAND$ <> "" THEN
  83.   
  84.    'Convert Switches to variables
  85.    CmdLength = LEN(COMMAND$)
  86.     
  87.    Switch = 1
  88.    FOR Letter = 1 TO CmdLength
  89.          
  90.        IF MID$(COMMAND$, Letter, 1) = " " THEN
  91.             
  92.           'Don't increment to the Next Word variable if the previous
  93.           'Word variable has not been used. This would happen in the
  94.           'case of a double space being encountered.
  95.           'NewSwitch is set to 1 when the present Word variable has been
  96.           'used.
  97.           IF NewSwitch = 0 THEN
  98.              Switch$ = ""
  99.              Switch = Switch + 1
  100.              NewSwitch = 1
  101.           END IF
  102.        ELSE
  103.           Switch$ = Switch$ + MID$(COMMAND$, Letter, 1)
  104.           NewSwitch = 0
  105.        END IF
  106.  
  107.        ' /? -? ?
  108.  
  109.        IF INSTR(Switch$, "?") THEN
  110.          
  111.           PRINT
  112.           PRINT " FDStat [/LOG={ [Path] Log File}]  [/OUT={ [Path] Output File }] "
  113.           PRINT "        [/BBS={BBS Screen Path}] [/NODE={Node}] [/NoPause] [/NoBeep] "
  114.           PRINT
  115.           PRINT " /LOG=  is used to specify the path & file name of the FD log to be"
  116.           PRINT "        processed. If /LOG is not used it will default to FD.LOG in"
  117.           PRINT "        the FD directory. If only a file name is supplied it will"
  118.           PRINT "        look for it in the FD directory. If a full path and file name"
  119.           PRINT "        is supplied it will process that log file. "
  120.           PRINT
  121.           PRINT " /OUT=  is used to direct the output to a path & filename."
  122.           PRINT "        If /OUT is not used it will default to FDSTAT.LOG in the FD "
  123.           PRINT "        directory (See /NODE). If only a file name is supplied it will "
  124.           PRINT "        place it in the FD directory. If a full path and file name is "
  125.           PRINT "        supplied it will place the output there. "
  126.           PRINT
  127.           PRINT " /BBS=  Causes BBS style FDSTAT.ANS/ASC/ASL screens from statistics"
  128.           PRINT "        screen to be placed in the supplied directory. (See /NODE)"
  129.           PRINT "        ie. /BBS=C:\BBS\SCREENS\"
  130.           PRINT
  131.           PRINT " /NODE= is used to modify the the filenames FDSTAT.LOG and FDSTAT.ANS/"
  132.           PRINT "        ASC/ASL (BBS Screens) to include a node number."
  133.           PRINT "        ie /NODE=1 will produce FDSTAT1.xxx  Other names not modified."
  134.           PRINT "more..."
  135.           DO WHILE ik$ = ""
  136.              ik$ = INKEY$
  137.           LOOP
  138.           PRINT
  139.           PRINT " /NoPause   means that the program will not pause and wait for you "
  140.           PRINT " /NP        to acknowledge the error message found in the FD log "
  141.           PRINT "            being processed."
  142.           PRINT
  143.           PRINT " /NoBeep    is used to stop the program from beeping when an an error "
  144.           PRINT " /NB        message was found in the FD log being processed."
  145.           PRINT
  146.           PRINT " Note: You can use path '.\{filename}' to indicate the current directory"
  147.           PRINT "       for /OUT= and /LOG= parameters."
  148.           PRINT
  149.           END
  150.        END IF
  151.  
  152.        ' was /DIR=[<Drive>:]<Path>
  153.  
  154.        IF UCASE$(LEFT$(Switch$, 5)) = "/DIR=" THEN
  155.           PRINT
  156.           PRINT "FrontDoor Statistics Generator "; VERSION$
  157.           BEEP
  158.           PRINT
  159.           PRINT "/DIR= is no longer a valid parameter as /LOG= can now"
  160.           PRINT "handle full paths. See documentation or type FDSTAT /?"
  161.           PRINT
  162.           END
  163.        END IF
  164.  
  165.  
  166.        ' /LOG=<FileName>
  167.  
  168.        IF UCASE$(LEFT$(Switch$, 5)) = "/LOG=" THEN
  169.           Log$ = MID$(Switch$, 6, LEN(Switch$))
  170.        END IF
  171.  
  172.  
  173.        ' /OUT=<FileName>
  174.  
  175.        IF UCASE$(LEFT$(Switch$, 5)) = "/OUT=" THEN
  176.           Out$ = MID$(Switch$, 6, LEN(Switch$))
  177.        END IF
  178.  
  179.  
  180.        ' /NOBEEP
  181.  
  182.        IF UCASE$(LEFT$(Switch$, 7)) = "/NOBEEP" OR UCASE$(LEFT$(Switch$, 3)) = "/NB" THEN
  183.           Beeps = 0
  184.        END IF
  185.  
  186.  
  187.        ' /NOPAUSE
  188.  
  189.        IF UCASE$(LEFT$(Switch$, 8)) = "/NOPAUSE" OR UCASE$(LEFT$(Switch$, 3)) = "/NP" THEN
  190.           Pause = 0
  191.        END IF
  192.    
  193.        ' /BBS=  Produce BBS Screens FDSTAT.ANS, FDSTAT.ASC and FDSTAT.ASL
  194.  
  195.        IF UCASE$(LEFT$(Switch$, 5)) = "/BBS=" THEN
  196.           BBS = MID$(Switch$, 6, LEN(Switch$))
  197.        END IF
  198.    
  199.        ' /NODE=  Produce BBS Screens FDSTAT.ANS, FDSTAT.ASC and FDSTAT.ASL
  200.  
  201.        IF UCASE$(LEFT$(Switch$, 6)) = "/NODE=" THEN
  202.           Node = MID$(Switch$, 7, LEN(Switch$))
  203.        END IF
  204.        IF LEN(Node) > 2 THEN
  205.           PRINT
  206.           PRINT "FrontDoor Statistics Generator "; VERSION$
  207.           BEEP
  208.           PRINT
  209.           PRINT "The /NODE parameter can only be 2 characters in length."
  210.           PRINT "You have supplied /NODE="; Node
  211.           PRINT
  212.           END
  213.        END IF
  214.  
  215.  
  216.     NEXT
  217. END IF
  218.  
  219.  
  220. '------------------------------------------------------------------------
  221. '    If Log location is not supplied Check for FD Environment variable
  222. '------------------------------------------------------------------------
  223. IF FDDir$ = "" THEN
  224.  
  225.    Env = Env + 1
  226.    DO WHILE ENVIRON$(Env) <> ""
  227.       IF LEFT$(ENVIRON$(Env), 3) = "FD=" THEN EXIT DO
  228.       Env = Env + 1
  229.    LOOP
  230.  
  231.    IF ENVIRON$(Env) = "" THEN
  232.       CLS
  233.       PRINT "Oh No! FD environment variable has not been set!"
  234.       PRINT
  235.       PRINT "       Typically you should have 'FD=C:\FD' in your AUTOEXEC.BAT"
  236.       PRINT "       Please read the FrontDoor documentation for help."
  237.       PRINT
  238.       PRINT "       OR you may use the /LOG and /OUT switch with full paths."
  239.       PRINT
  240.       PRINT "Ending FDStat! "; VERSION$; "    :("
  241.       END
  242.    END IF
  243.  
  244.    Env$ = MID$(ENVIRON$(Env), 4, LEN(ENVIRON$(Env)))
  245.    FDDir$ = Env$
  246.  
  247. END IF
  248.  
  249. IF Env$ = "" THEN
  250.    IF FDDir$ = "" THEN
  251.       Env$ = "* FD Environment variable not found *"
  252.    ELSE
  253.       Env$ = "* /LOG=<dir> or /BBS=<dir> invalid, or /LOG=<log file> not found *"
  254.    END IF
  255. END IF
  256.  
  257. '--------------------------------------------------------------------------
  258. '              Set input and output file variables
  259. '--------------------------------------------------------------------------
  260. IF Log$ = "" THEN Log$ = "FD.LOG"
  261. IF Out$ = "" THEN Out$ = "FDSTAT" + Node$ + ".LOG"
  262.  
  263. IF RIGHT$(FDDir$, 1) <> "\" THEN FDDir$ = FDDir$ + "\"
  264.  
  265. IF (INSTR(Log$, ":") <> 2) AND (INSTR(Log$, "\") = 0) THEN
  266.    FDLog$ = UCASE$(FDDir$ + Log$)       ' Log File
  267. ELSE
  268.    FDLog$ = UCASE$(Log$)                ' Log File
  269. END IF
  270.  
  271.  
  272. IF (INSTR(Out$, ":") <> 2) AND (INSTR(Out$, "\") = 0) THEN
  273.    FDStatFile$ = UCASE$(FDDir$ + Out$)       ' Output File
  274. ELSE
  275.    FDStatFile$ = UCASE$(Out$)              ' Output File
  276. END IF
  277.  
  278. IF RIGHT$(BBS, 1) <> "\" THEN BBS = BBS + "\"
  279.  
  280.  
  281. '--------------------------------------------------------------------------
  282. '                      Draw Screen for Stats
  283. '--------------------------------------------------------------------------
  284.  
  285. CALL DrawScreen(VERSION$)
  286.  
  287. Processing$ = "Processing Log... " + UCASE$(FDLog$) + " into " + FDStatFile$
  288. LOCATE 25, 80 - LEN(Processing$)
  289. COLOR 11, 0
  290. PRINT Processing$;
  291.  
  292. MaxUnexPass = 50
  293. DIM UnexPass(50) AS STRING
  294. MaxAKA = 50
  295. DIM AKAStr(50) AS STRING
  296. DIM ConnPoll(14)
  297.  
  298. DIM ConnInHuman(16)               'Human Connections per CONNECT speed
  299. DIM ConnInComp(14)                'Comp  Connections per CONNECT speed
  300. DIM ConnOutComp(14)
  301. DIM FilesOutBytesTotal(14) AS LONG        '
  302. DIM FilesOutBytesSession AS LONG        '
  303. DIM FilesOutSecs(14)
  304. DIM FilesOutCPS(14)
  305. DIM FilesOut(14)
  306. DIM FilesInBytesTotal(14) AS LONG
  307. DIM FilesInBytesSession AS LONG
  308. DIM FilesInSecs(14)
  309. DIM FilesInCPS(14)
  310. DIM FilesIn(14)
  311. DIM ConnInHumanRow%(16)
  312. DIM ConnInHumanCol%(16)
  313. DIM ConnInCompRow%(14)
  314. DIM ConnInCompCol%(14)
  315. DIM ConnOutCompRow%(14)
  316. DIM ConnOutCompCol%(14)
  317. DIM FilesRow%(14)
  318. DIM FilesInConnCol%(14)         ''was files sent recieved in in/out file box
  319. DIM FilesOutConnCol%(14)        ''
  320. DIM FilesInKbCol%(14)
  321. DIM FilesOutKbCol%(14)
  322. DIM FilesInCPSCol%(14)
  323. DIM FilesOutCPSCol%(14)
  324. DIM KbOut AS LONG
  325. DIM KbIn AS LONG
  326. DIM LogLine AS LONG
  327. DIM TossStartInSecs AS LONG
  328. DIM TossEndInSecs AS LONG
  329. DIM TossTime AS LONG
  330. ConnInHumanRow%(1) = 16: ConnInHumanRow%(2) = 17: ConnInHumanRow%(3) = 18: ConnInHumanRow%(4) = 19:
  331. ConnInHumanRow%(5) = 16: ConnInHumanRow%(6) = 17: ConnInHumanRow%(7) = 18: ConnInHumanRow%(8) = 19:
  332. ConnInHumanRow%(9) = 16: ConnInHumanRow%(10) = 17: ConnInHumanRow%(11) = 18: ConnInHumanRow%(12) = 19:
  333. ConnInHumanRow%(13) = 16: ConnInHumanRow%(14) = 17: ConnInHumanRow%(15) = 18: ConnInHumanRow%(16) = 19:
  334.  
  335. ConnInHumanCol%(1) = 7: ConnInHumanCol%(2) = 7: ConnInHumanCol%(3) = 7: ConnInHumanCol%(4) = 7:
  336. ConnInHumanCol%(5) = 16: ConnInHumanCol%(6) = 16: ConnInHumanCol%(7) = 16: ConnInHumanCol%(8) = 16:
  337. ConnInHumanCol%(9) = 26: ConnInHumanCol%(10) = 26: ConnInHumanCol%(11) = 26: ConnInHumanCol%(12) = 26:
  338. ConnInHumanCol%(13) = 36: ConnInHumanCol%(14) = 36: ConnInHumanCol%(15) = 36: ConnInHumanCol%(16) = 36:
  339.  
  340. ConnInCompRow%(1) = 8: ConnInCompRow%(2) = 9: ConnInCompRow%(3) = 10:
  341. ConnInCompRow%(4) = 11: ConnInCompRow%(5) = 12: ConnInCompRow%(6) = 13: ConnInCompRow%(7) = 14
  342. ConnInCompRow%(8) = 8: ConnInCompRow%(9) = 9: ConnInCompRow%(10) = 10:
  343. ConnInCompRow%(11) = 11: ConnInCompRow%(12) = 12: ConnInCompRow%(13) = 13: ConnInCompRow%(14) = 14
  344.  
  345. ConnOutCompCol%(1) = 8: ConnOutCompCol%(2) = 8: ConnOutCompCol%(3) = 8:
  346. ConnOutCompCol%(4) = 8: ConnOutCompCol%(5) = 8: ConnOutCompCol%(6) = 8: ConnOutCompCol%(7) = 8:
  347. ConnOutCompCol%(8) = 47: ConnOutCompCol%(9) = 47: ConnOutCompCol%(10) = 47:
  348. ConnOutCompCol%(11) = 47: ConnOutCompCol%(12) = 47: ConnOutCompCol%(13) = 47: ConnOutCompCol%(14) = 47:
  349.  
  350. ConnOutCompRow%(1) = 8: ConnOutCompRow%(2) = 9: ConnOutCompRow%(3) = 10:
  351. ConnOutCompRow%(4) = 11: ConnOutCompRow%(5) = 12: ConnOutCompRow%(6) = 13: ConnOutCompRow%(7) = 14
  352. ConnOutCompRow%(8) = 8: ConnOutCompRow%(9) = 9: ConnOutCompRow%(10) = 10:
  353. ConnOutCompRow%(11) = 11: ConnOutCompRow%(12) = 12: ConnOutCompRow%(13) = 13: ConnOutCompRow%(14) = 14
  354.  
  355. ConnInCompCol%(1) = 12: ConnInCompCol%(2) = 12: ConnInCompCol%(3) = 12:
  356. ConnInCompCol%(4) = 12: ConnInCompCol%(5) = 12: ConnInCompCol%(6) = 12: ConnInCompCol%(7) = 12:
  357. ConnInCompCol%(8) = 51: ConnInCompCol%(9) = 51: ConnInCompCol%(10) = 51:
  358. ConnInCompCol%(11) = 51: ConnInCompCol%(12) = 51: ConnInCompCol%(13) = 51: ConnInCompCol%(14) = 51:
  359.  
  360. FilesRow%(1) = 8: FilesRow%(2) = 9: FilesRow%(3) = 10:
  361. FilesRow%(4) = 11: FilesRow%(5) = 12: FilesRow%(6) = 13: FilesRow%(7) = 14:
  362. FilesRow%(8) = 8: FilesRow%(9) = 9: FilesRow%(10) = 10:
  363. FilesRow%(11) = 11: FilesRow%(12) = 12: FilesRow%(13) = 13: FilesRow%(14) = 14
  364.  
  365. FilesInKbCol%(1) = 16: FilesInKbCol%(2) = 16: FilesInKbCol%(3) = 16:
  366. FilesInKbCol%(4) = 16: FilesInKbCol%(5) = 16: FilesInKbCol%(6) = 16: FilesInKbCol%(7) = 16:
  367. FilesInKbCol%(8) = 55: FilesInKbCol%(9) = 55: FilesInKbCol%(10) = 55:
  368. FilesInKbCol%(11) = 55: FilesInKbCol%(12) = 55: FilesInKbCol%(13) = 55: FilesInKbCol%(14) = 55:
  369.  
  370. FilesOutKbCol%(1) = 22: FilesOutKbCol%(2) = 22: FilesOutKbCol%(3) = 22:
  371. FilesOutKbCol%(4) = 22: FilesOutKbCol%(5) = 22: FilesOutKbCol%(6) = 22: FilesOutKbCol%(7) = 22:
  372. FilesOutKbCol%(8) = 61: FilesOutKbCol%(9) = 61: FilesOutKbCol%(10) = 61:
  373. FilesOutKbCol%(11) = 61: FilesOutKbCol%(12) = 61: FilesOutKbCol%(13) = 61: FilesOutKbCol%(14) = 61:
  374.  
  375. FilesOutCPSCol%(1) = 28: FilesOutCPSCol%(2) = 28: FilesOutCPSCol%(3) = 28:
  376. FilesOutCPSCol%(4) = 28: FilesOutCPSCol%(5) = 28: FilesOutCPSCol%(6) = 28: FilesOutCPSCol%(7) = 28:
  377. FilesOutCPSCol%(8) = 67: FilesOutCPSCol%(9) = 67: FilesOutCPSCol%(10) = 67:
  378. FilesOutCPSCol%(11) = 67: FilesOutCPSCol%(12) = 67: FilesOutCPSCol%(13) = 67: FilesOutCPSCol%(14) = 67:
  379.  
  380. FilesInCPSCol%(1) = 33: FilesInCPSCol%(2) = 33: FilesInCPSCol%(3) = 33:
  381. FilesInCPSCol%(4) = 33: FilesInCPSCol%(5) = 33: FilesInCPSCol%(6) = 33: FilesInCPSCol%(7) = 33:
  382. FilesInCPSCol%(8) = 72: FilesInCPSCol%(9) = 72: FilesInCPSCol%(10) = 72:
  383. FilesInCPSCol%(11) = 72: FilesInCPSCol%(12) = 72: FilesInCPSCol%(13) = 72: FilesInCPSCol%(14) = 72:
  384.  
  385. DO
  386.    Restart = FALSE
  387.   
  388.    IF FDLog$ = "" OR FDStatFile$ = "" THEN
  389.       PRINT "One or more files could not be found!"
  390.       END
  391.    ELSE
  392.  
  393.       ' Otherwise, open the file, assigning it the
  394.       ' next available file number:
  395.       FDLogFile = FREEFILE
  396.       OPEN FDLog$ FOR INPUT AS FDLogFile
  397.       FDStatOut = FREEFILE
  398.       OPEN FDStatFile$ FOR OUTPUT AS FDStatOut
  399.       PRINT #FDStatOut, "┌─────────────────────────────────────────────────────────────────────────────┐"
  400.       PRINT #FDStatOut, "│ FrontDoor Statistics Generator "; VERSION$; TAB(41); " Scott Hall 3:712/393 shall@world.net │"
  401.       PRINT #FDStatOut, "└─────────────────────────────────────────────────────────────────────────────┘"
  402.       PRINT #FDStatOut, " Produced on: "; ADATE$; " at "; TIME$; " from "; FDLog$;
  403.       IF Node <> "" THEN PRINT #FDStatOut, " for Node "; Node;
  404.       PRINT #FDStatOut,
  405.    END IF
  406.  
  407.    IF NOT Restart THEN
  408.  
  409.       ' *** Process FrontDoor Log ***
  410.    
  411.       LineNum = 1
  412.       DO WHILE NOT EOF(FDLogFile)
  413.          InsidePoll = 0
  414.          DIM Word$(30)
  415.          PollingBBS$ = " <Unknown> "
  416.          FilesInBytesSession = 0
  417.          FilesOutBytesSession = 0
  418.          FilesInSecsSession = 0
  419.          FilesOutSecsSession = 0
  420.          FilesInCPSSession = 0
  421.          FilesOutCPSSession = 0
  422.          ConnBaud = 0
  423.          Secs = 0
  424.          CPS = 0
  425.  
  426.          IF NoLineGet = 0 THEN GOSUB FDLine
  427.          NoLineGet = 0
  428.         
  429.          '-----------------------------------------------------------
  430.          'Process each line of FD.LOG according to Words encountered!
  431.          '-----------------------------------------------------------
  432.  
  433.          GOSUB Date
  434.          GOSUB Time
  435.          IF Word$(3) = "RING" THEN GOSUB ring
  436.          IF Word$(3) = "Calling" THEN GOSUB Calling
  437.         
  438.          IF MID$(LineBuffer$, 13, 26) = "Mail received, errorlevel=" THEN
  439.             TossTimeMin = 0
  440.             TossTimeSecs = 0
  441.             TossStart$ = TimeCurrent$
  442.             IF LEN(TossStart$) = 7 THEN TossStart$ = "0" + TossStart$
  443.             GOSUB FDLine
  444.             DO UNTIL INSTR(Word$(2), ":")
  445.                GOSUB FDLine
  446.             LOOP
  447.             IF LEN(Word$(2)) = 7 THEN Word$(2) = "0" + Word$(2)
  448.             TossStartInSecs = VAL(RIGHT$(TossStart$, 2)) + (60 * VAL(MID$(TossStart$, 4, 2))) + (3600 * VAL(LEFT$(TossStart$, 2)))
  449.             TossEndInSecs = VAL(RIGHT$(Word$(2), 2)) + (60 * VAL(MID$(Word$(2), 4, 2))) + (3600 * VAL(LEFT$(Word$(2), 2)))
  450.             TossTimeSecs = TossEndInSecs - TossStartInSecs
  451.             IF TossTimeSecs < 0 THEN TossTimeSecs = (60 * 24) - TossTimeSecs
  452.             DO UNTIL TossTimeSecs < 60
  453.                TossTimeMin = TossTimeMin + 1
  454.                TossTimeSecs = TossTimeSecs - 60
  455.             LOOP
  456.             TTSec$ = LTRIM$(STR$(TossTimeSecs))
  457.             IF LEN(TTSec$) = 1 THEN TTSec$ = "0" + TTSec$
  458.             PRINT #FDStatOut, "                     Toss:   "; LTRIM$(STR$(TossTimeMin)); ":"; TTSec$; ", ("; TossStart$; " - "; Word$(2); ")"
  459.          END IF
  460.          '-----------------------------------------------------------
  461.  
  462.        LOOP
  463.        CLOSE FileNum             ' Close the file.
  464.  
  465.    END IF
  466. LOOP WHILE Restart = True
  467.  
  468. ' ------------------------------------------------------------------------
  469. ' EOF Proceedures
  470. ' ------------------------------------------------------------------------
  471. EndOfFile:
  472. COLOR DATEFORE, DATEBACK
  473. LOCATE 23, 45
  474. PRINT DateCurrent$; "  ";
  475. LOCATE 23, 60
  476. IF LEN(TimeCurrent$) = 7 THEN PRINT "0";
  477. PRINT TimeCurrent$;
  478. LOCATE 24, 69
  479. COLOR 3, 0
  480. PRINT "  Writing...";
  481. LOCATE 24, 80
  482. PRINT #FDStatOut,
  483.  
  484. BBSScreens FDStatOut, BBS, Node
  485.  
  486. CLOSE FDLogFile, FDStatOut
  487. LOCATE 24, 69
  488. COLOR 3, 0
  489. PRINT "  Completed!";
  490. COLOR DosForeClr, DosBackClr
  491. END
  492.  
  493. '===========================================================================
  494. '==================================== EXIT =================================
  495. '===========================================================================
  496.  
  497.                                                                             
  498. ' FrontDoor Log individual line proceedures. Each is executed depending on
  499. ' the words encountered on each line of the LOG.
  500.                                                                           
  501.  
  502. '--------------------------------------------------------------------------
  503. ' Obtain opening log date & current date being processed. Current date
  504. ' will be used to find end of log date when EOF is found.
  505. '--------------------------------------------------------------------------
  506. Date:
  507.  
  508. IF DateBegin = 0 AND Word$(1) = "----------" THEN
  509.    IF Word$(2) = "" THEN GOSUB FDLine
  510.    DateBegin$ = Word$(2) + " " + Word$(3) + " " + Word$(4) + " " + Word$(5)
  511.    DateBegin = 1
  512.    LOCATE 24, 1
  513.    COLOR DATEFORE, DATEBACK
  514.    PRINT SPACE$(80);
  515.    LOCATE 23, 12
  516.    PRINT DateBegin$
  517. END IF
  518. IF Word$(1) = "----------" THEN
  519.    DateCurrent$ = Word$(2) + " " + Word$(3) + " " + Word$(4) + " " + Word$(5)
  520.    IF DateCurrent$ <> DateOld$ THEN
  521.       PRINT #FDStatOut,
  522.       PRINT #FDStatOut, LineBuffer$
  523.    END IF
  524.    DateOld$ = DateCurrent$
  525. END IF
  526. COLOR NORMALFORE, NORMALBACK
  527. RETURN
  528.  
  529. '---------------------------------------------------------------------------
  530. ' Obtain opening log time & current time being processed. Current time
  531. ' will be used to find end of log time when EOF is found.
  532. '---------------------------------------------------------------------------
  533. Time:
  534. IF LEFT$(Word$(2), 1) = "0" THEN TimeCurrent$ = Word$(2)
  535. IF LEFT$(Word$(2), 1) = "1" THEN TimeCurrent$ = Word$(2)
  536. IF LEFT$(Word$(2), 1) = "2" THEN TimeCurrent$ = Word$(2)
  537. IF LEFT$(Word$(2), 1) = "3" THEN TimeCurrent$ = Word$(2)
  538. IF LEFT$(Word$(2), 1) = "4" THEN TimeCurrent$ = Word$(2)
  539. IF LEFT$(Word$(2), 1) = "5" THEN TimeCurrent$ = Word$(2)
  540. IF LEFT$(Word$(2), 1) = "6" THEN TimeCurrent$ = Word$(2)
  541. IF LEFT$(Word$(2), 1) = "7" THEN TimeCurrent$ = Word$(2)
  542. IF LEFT$(Word$(2), 1) = "8" THEN TimeCurrent$ = Word$(2)
  543. IF LEFT$(Word$(2), 1) = "9" THEN TimeCurrent$ = Word$(2)
  544. IF TimeBegin = 0 AND TimeCurrent$ <> "" THEN
  545.    TimeBegin$ = TimeCurrent$
  546.    TimeBegin = 1
  547.    COLOR DATEFORE, DATEBACK
  548.    LOCATE 23, 27
  549.    IF LEN(TimeBegin$) = 7 THEN PRINT "0";
  550.    PRINT TimeBegin$
  551.    LOCATE 23, 45
  552.    PRINT "Processing line:"
  553.    COLOR NORMALFORE, NORMALBACK
  554. END IF
  555. RETURN
  556.  
  557. '---------------------------------------------------------------------------
  558. ' Incoming caller/poller detected (RING). Process stats on transaction
  559. '---------------------------------------------------------------------------
  560. ring:
  561. InsidePoll = -1
  562. AKA = 1
  563. GOSUB FDLine
  564.  
  565. IF Word$(3) = "RING" OR Word$(3) = "DFRS:" THEN GOTO ring
  566.  
  567. ' Get CONNECT baud Rate
  568. ' Determine if Human or Computer Caller and total calls
  569.  
  570. ' IF NOT CONNECT RECIEVED SEE AFTER THE ELSE COMMAND BELOW!!!
  571.  
  572. IF Word$(3) = "CONNECT" THEN
  573.   IF VAL(LEFT$(Word$(4), 5)) >= 0 THEN ConnPoll = 1
  574.   IF VAL(LEFT$(Word$(4), 5)) >= 4800 THEN ConnPoll = 2
  575.   IF VAL(LEFT$(Word$(4), 5)) >= 7200 THEN ConnPoll = 3
  576.   IF VAL(LEFT$(Word$(4), 5)) >= 9600 THEN ConnPoll = 4
  577.   IF VAL(LEFT$(Word$(4), 6)) >= 12000 THEN ConnPoll = 5
  578.   IF VAL(LEFT$(Word$(4), 6)) >= 14400 THEN ConnPoll = 6
  579.   IF VAL(LEFT$(Word$(4), 6)) >= 16800 THEN ConnPoll = 7
  580.   IF VAL(LEFT$(Word$(4), 6)) >= 19200 THEN ConnPoll = 8
  581.   IF VAL(LEFT$(Word$(4), 6)) >= 21600 THEN ConnPoll = 9
  582.   IF VAL(LEFT$(Word$(4), 6)) >= 24000 THEN ConnPoll = 10
  583.   IF VAL(LEFT$(Word$(4), 6)) >= 26400 THEN ConnPoll = 11
  584.   IF VAL(LEFT$(Word$(4), 6)) >= 28800 THEN ConnPoll = 12
  585.   IF VAL(LEFT$(Word$(4), 6)) >= 31200 THEN ConnPoll = 13
  586.   IF VAL(LEFT$(Word$(4), 6)) >= 33600 THEN ConnPoll = 14
  587.   IF VAL(LEFT$(Word$(4), 4)) >= 300 THEN ConnHuman = 1
  588.   IF VAL(LEFT$(Word$(4), 5)) >= 1200 THEN ConnHuman = 2
  589.   IF VAL(LEFT$(Word$(4), 5)) >= 2400 THEN ConnHuman = 3
  590.   IF VAL(LEFT$(Word$(4), 5)) >= 4800 THEN ConnHuman = 4
  591.   IF VAL(LEFT$(Word$(4), 5)) >= 7200 THEN ConnHuman = 5
  592.   IF VAL(LEFT$(Word$(4), 5)) >= 9600 THEN ConnHuman = 6
  593.   IF VAL(LEFT$(Word$(4), 6)) >= 12000 THEN ConnHuman = 7
  594.   IF VAL(LEFT$(Word$(4), 6)) >= 14400 THEN ConnHuman = 8
  595.   IF VAL(LEFT$(Word$(4), 6)) >= 16800 THEN ConnHuman = 9
  596.   IF VAL(LEFT$(Word$(4), 6)) >= 19200 THEN ConnHuman = 10
  597.   IF VAL(LEFT$(Word$(4), 6)) >= 21600 THEN ConnHuman = 11
  598.   IF VAL(LEFT$(Word$(4), 6)) >= 24000 THEN ConnHuman = 12
  599.   IF VAL(LEFT$(Word$(4), 6)) >= 26400 THEN ConnHuman = 13
  600.   IF VAL(LEFT$(Word$(4), 6)) >= 28800 THEN ConnHuman = 14
  601.   IF VAL(LEFT$(Word$(4), 6)) >= 31200 THEN ConnHuman = 15
  602.   IF VAL(LEFT$(Word$(4), 6)) >= 33600 THEN ConnHuman = 16
  603.  
  604.   'IF ConnHuman >= 9 THEN FieldsFore = 2 ELSE FieldsFore = 3
  605.  
  606.   ConnPoll$ = Word$(4) + " " + Word$(5) + " " + Word$(6) + " " + Word$(7)
  607.   ConnBaud = 1
  608.   GOSUB FDLine
  609.        
  610.   IF MID$(LineBuffer$, 13, 15) = "Sending text in" THEN
  611.      REM do nothing... because we want Rejecting.. Incoming.. Unexpected
  612.      REM or BBS Name
  613.      GOSUB FDLine
  614.   END IF
  615.  
  616.   'If = or ! found for first word then exit Caller Processing because
  617.   ' = means that the modem got RING, NO CARRIER, BUSY etc. and
  618.   ' and - means user hit Func key or "- HH:MM:SS Preparing outbound mail"
  619.   ' so the caller must have been lost without error message
  620.   ' being produced in the log.
  621.   IF Word$(1) = "=" OR Word$(1) = "-" OR Word$(1) = "!" OR Word$(1) = "" OR Word$(3) = "Calling" OR (Word$(3) = "Preparing" AND Word$(4) = "outbound" AND Word$(5) = "mail") THEN
  622. ConnInFail:
  623.      NoLineGet = 1
  624.      HumanInFailed = HumanInFailed + 1
  625.      LOCATE 21, 29
  626.      COLOR 12, 0
  627.      PRINT USING "####"; HumanInFailed
  628.      COLOR FieldsFore, FILELDSBACK
  629.      PRINT #FDStatOut,
  630.      IF CommentFail$ = "" THEN CommentFail$ = " (unable to process)"
  631.      PRINT #FDStatOut, LEFT$(LineBuffer2$, 12); "   Lost: "; MID$(LineBuffer2$, 13, 38); CommentFail$
  632.      LOCATE 24, 1
  633.      PRINT "                                                                                ";
  634.      LOCATE 24, 1
  635.      COLOR 12, 0
  636.      PRINT DateCurrent$; " "; LEFT$(LineBuffer2$, 45); CommentFail$;
  637.      CommentFail$ = ""
  638.      IF Beeps = 1 THEN BEEP
  639.      IF Pause = 1 THEN
  640.         PressEnter Pause, Beeps
  641.      END IF
  642.      RETURN
  643.   END IF
  644.  
  645.   IF Word$(3) = "Rejecting" THEN
  646.       HumanReject = HumanReject + 1
  647.       COLOR 11
  648.       LOCATE 21, 17
  649.       PRINT USING "####"; HumanReject
  650.          
  651.   ELSE
  652.       IF Word$(3) = "Incoming" THEN
  653.          ConnInHuman(ConnHuman) = ConnInHuman(ConnHuman) + 1
  654.          LOCATE ConnInHumanRow%(ConnHuman), ConnInHumanCol%(ConnHuman)
  655.          PRINT USING "###"; ConnInHuman(ConnHuman)
  656.          ConnInHuman = ConnInHuman + 1
  657.          LOCATE 20, 29
  658.          COLOR 10
  659.          PRINT USING "####"; ConnInHuman
  660.       ELSE
  661.            
  662.          '******  Process Computer Connection (ConnPoll) *********************
  663.  
  664.          ConnInComp(ConnPoll) = ConnInComp(ConnPoll) + 1
  665.          LOCATE ConnInCompRow%(ConnPoll), ConnInCompCol%(ConnPoll)
  666.          PRINT USING "###"; ConnInComp(ConnPoll)
  667.  
  668.          PRINT #FDStatOut,
  669.         
  670.          DO
  671.         
  672.           'Test if we lost connection!
  673.           IF (Word$(3) = "Calling" AND INSTR(LineBuffer$, ",") > 1 AND INSTR(LineBuffer$, ":") > 1 AND INSTR(LineBuffer$, "/") > 1) OR (Word$(1) = "+" AND Word$(3) = "RING") OR (Word$(1) = "----------") OR (Word$(3) = "Event" AND MID$(Word$(4), 2, 1 _
  674. ) = "-") THEN
  675.              NoLineGet = 1
  676.              IF UnexPass > 1 OR BBSNameFound = 1 THEN
  677.                 ConnInFailed = ConnInFailed + 1
  678.                 LOCATE 20, 50
  679.                 COLOR 12, 0
  680.                 PRINT USING "####"; ConnInFailed
  681.                 COLOR FieldsFore, FILELDSBACK
  682.                 LOCATE 24, 1
  683.                 PRINT "                                                                                ";
  684.                 LOCATE 24, 1
  685.                 COLOR 12, 0
  686.                 PRINT DateCurrent$; SPACE$(11 - LEN(TimeCurrent$)); TimeCurrent$; "  > Poll ended abnormally! <";
  687.                 PRINT #FDStatOut, "              ERROR: > Poll ended abnormally! <"
  688.                 IF Beeps = 1 THEN BEEP
  689.                 IF Pause = 1 THEN
  690.                    PressEnter Pause, Beeps
  691.                 END IF
  692.              ELSE
  693.                 HumanInFailed = HumanInFailed + 1
  694.                 LOCATE 21, 29
  695.                 COLOR 12, 0
  696.                 PRINT USING "####"; HumanInFailed
  697.                 COLOR FieldsFore, FILELDSBACK
  698.                 LOCATE 24, 1
  699.                 PRINT "                                                                                ";
  700.                 LOCATE 24, 1
  701.                 COLOR 12, 0
  702.                 'PRINT DateCurrent$; SPACE$(11 - LEN(TimeCurrent2$)); TimeCurrent2$; "  Lost: "; MID$(LineBuffer2$, 13)
  703.                 PRINT LEFT$(LineBuffer2$, 45); " (unable to process)";
  704.                 PRINT #FDStatOut, LEFT$(LineBuffer2$, 12); "   Lost: "; MID$(LineBuffer2$, 13, 38); " (unable to process)"
  705.                 'PRINT #FDStatOut, "              ERROR: > Poll ended abnormally! <"
  706.                 IF Beeps = 1 THEN BEEP
  707.                 IF Pause = 1 THEN
  708.                    PressEnter Pause, Beeps
  709.                 END IF
  710.              END IF
  711.              EXIT DO
  712.           END IF
  713.         
  714.           'Constantly Process computer connection data until
  715.           ' "From <Node>, <Time>, <Cost>" encountered indicating end of poll info.
  716.          
  717.           IF Word$(3) = "From" THEN
  718.                COLOR 2, 0
  719.                TimeInPollersSecs = TimeInPollersSecs + (VAL(RIGHT$(Word$(5), 3)) + 60 * VAL(Word$(5)))
  720.                DO WHILE TimeInPollersSecs > 59
  721.                   TimeInPollersMins = TimeInPollersMins + 1
  722.                   TimeInPollersSecs = TimeInPollersSecs - 60
  723.                LOOP
  724.                LOCATE 18, 49
  725.                PRINT USING "###"; TimeInPollersMins
  726.                LOCATE 18, 52: PRINT ":";
  727.                LOCATE 18, 53
  728.                IF TimeInPollersSecs > 9 THEN
  729.                   PRINT USING "##"; TimeInPollersSecs
  730.                ELSE
  731.                   PRINT "0"; LTRIM$(STR$(TimeInPollersSecs))
  732.                END IF
  733.                EXIT DO: REM Exit the Major Do for Polling/Poller processing.
  734.           END IF
  735.  
  736.           DO WHILE Word$(3) = "Unexpected" AND Word$(4) = "password,"
  737.                UnexPass = UnexPass + 1          ''''''
  738.                UnexPass(UnexPass) = Word$(7)
  739.                GOSUB FDLine
  740.             LOOP
  741.             IF Word$(3) = "Password" AND Word$(4) = "error:" THEN
  742.                ErrorPassword = ErrorPassword + 1
  743.                ErrorOther = ErrorOther - 1
  744.                LOCATE 20, 75
  745.                COLOR 12, 0
  746.                PRINT USING "###"; ErrorPassword
  747.                COLOR FieldsFore, FieldsBack
  748.             END IF
  749.             IF Word$(3) = "Session" AND Word$(4) = "handshake" AND Word$(5) = "failure" THEN
  750.                ErrorPoller = ErrorPoller + 1
  751.                ErrorOther = ErrorOther - 1
  752.                LOCATE 20, 50
  753.                COLOR 12, 0
  754.                PRINT USING "####"; ErrorPoller
  755.                COLOR FieldsFore, FieldsBack
  756.             END IF
  757.             IF Word$(1) = "?" OR (Word$(3) = "Terminating" AND Word$(4) = "call") THEN
  758.                COLOR 12, 0
  759.                ErrorOther = ErrorOther + 1
  760.               
  761.                ' Process Sent incomplete error
  762.            
  763.                IF Word$(6) = "(incomplete)" THEN
  764.                   IF Word$(3) = "Send" THEN FileOutError = FileOutError + 1
  765.                   IF Word$(3) = "Rcvd" THEN FileInError = FileInError + 1
  766.                   ErrorOther = ErrorOther - 1
  767.                   LOCATE 21, 64
  768.                   IF FileOutError > 0 THEN PRINT USING "###"; FileOutError
  769.                   LOCATE 20, 64
  770.                   IF FileInError > 0 THEN PRINT USING "###"; FileInError
  771.                END IF
  772.  
  773.                LOCATE 21, 75
  774.                IF ErrorOther <> 0 THEN PRINT USING "###"; ErrorOther
  775.               
  776.                'Print error except for passwords in password error
  777.                IF Word$(3) = "Password" AND Word$(4) = "error:" THEN
  778.                   PRINT #FDStatOut, LEFT$(LineBuffer$, 12); "  ERROR: Password error from "; Word$(10)
  779.                ELSE
  780.                   PRINT #FDStatOut, LEFT$(LineBuffer$, 12); "  ERROR: "; MID$(LineBuffer$, 13, LEN(LineBuffer$) - 12)
  781.                END IF
  782.               
  783.                LOCATE 24, 1
  784.                PRINT "                                                                                ";
  785.                LOCATE 24, 1
  786.                COLOR 12, 0
  787.                PRINT DateCurrent$; " "; LEFT$(LineBuffer$, 65);
  788.                IF Beeps = 1 THEN BEEP
  789.                IF Pause = 1 THEN
  790.                   PressEnter Pause, Beeps
  791.                END IF
  792.                
  793.                IF Word$(3) = "Session" AND Word$(4) = "handshake" AND Word$(5) = "failure" THEN
  794.                   BBSNameFound = 0
  795.                   PrtConn = 0
  796.                   UnexPass = 0
  797.                   UnexPassTest = 0
  798.                   ERASE UnexPass
  799.                   ERASE AKAStr
  800.                   InString = 0
  801.                   PollingBBS$ = " <Unknown> "
  802.                   'PRINT #FDStatOut,
  803.                   RETURN
  804.                   'EXIT DO
  805.                END IF
  806.             END IF
  807.             
  808.             IF BBSNameFound = 0 AND Word$(1) = "+" THEN
  809.                IF MID$(LineBuffer$, 13) = "Rescan requested" THEN GOTO ConnInFail ' 1.66
  810.                IF MID$(LineBuffer$, 13, 7) = "Event 0" THEN GOTO ConnInFail
  811.                IF MID$(LineBuffer$, 13, 7) = "Event 1" THEN GOTO ConnInFail
  812.                IF MID$(LineBuffer$, 13, 7) = "Event 2" THEN GOTO ConnInFail
  813.                IF MID$(LineBuffer$, 13, 7) = "Event 3" THEN GOTO ConnInFail
  814.                IF MID$(LineBuffer$, 13, 7) = "Event 4" THEN GOTO ConnInFail
  815.                IF MID$(LineBuffer$, 13, 7) = "Event 5" THEN GOTO ConnInFail
  816.                IF MID$(LineBuffer$, 13, 7) = "Event 6" THEN GOTO ConnInFail
  817.                IF MID$(LineBuffer$, 13, 7) = "Event 7" THEN GOTO ConnInFail
  818.                IF MID$(LineBuffer$, 13, 7) = "Event 8" THEN GOTO ConnInFail
  819.                IF MID$(LineBuffer$, 13, 7) = "Event 9" THEN GOTO ConnInFail
  820.                'Line$ = LEFT$(LineBuffer$, INSTR(LineBuffer$, ","))
  821.                'IF Line$ = "" THEN Line$ = LineBuffer$ + CHR$(13) + CHR$(10)    'Handles FTS-1 protocol
  822.                'PRINT #FDStatOut,
  823.                PRINT #FDStatOut, LEFT$(LineBuffer$, 12); " Poller:"; 'MID$(LineBuffer$, 13, INSTR(1, LineBuffer$, ",")); ", ";
  824.               
  825.                FOR n = 3 TO 30
  826.                    IF Word$(n) <> "" THEN
  827.                       IF Comma = 0 THEN
  828.                          PRINT #FDStatOut, " "; Word$(n);
  829.                       ELSE
  830.                          IF INSTR(Word$(n), ":") > 1 AND INSTR(Word$(n), "/") > 1 THEN
  831.                             PRINT #FDStatOut, " "; Word$(n); ", ";
  832.                             Comma = 0
  833.                             EXIT FOR
  834.                          END IF
  835.                       END IF
  836.                       IF RIGHT$(Word$(n), 1) = "," THEN
  837.                          Comma = 1
  838.                       END IF
  839.                    ELSE
  840.                       EXIT FOR
  841.                    END IF
  842.                NEXT
  843.               
  844.                BBSNameFound = 1
  845.               
  846.                IF PrtConn = 0 THEN
  847.                   PRINT #FDStatOut, RTRIM$(ConnPoll$)
  848.                   PrtConn = 1
  849.                END IF
  850.  
  851.                'Obtain Main Address from <The BBS Name>, <Main Address>
  852.                DO WHILE AKAStr(0) = ""
  853.                   InString = InString + 1
  854.                   IF Word$(InString) = "" THEN EXIT DO
  855.                   IF INSTR(Word$(InString), "/") > 0 AND INSTR(Word$(InString), ":") > 0 THEN
  856.                      AKAStr(0) = Word$(InString)
  857.                   END IF
  858.                LOOP
  859.             END IF
  860.          
  861.             'Get Other AKAs
  862.  
  863.             IF Word$(3) = "AKA:" THEN
  864.                AKAStr(AKA) = Word$(4)
  865.                AKAStr(AKA + 1) = Word$(5)
  866.                AKAStr(AKA + 2) = Word$(6)
  867.                AKA = AKA + 3
  868.             END IF
  869.          
  870.             'Compare Unexpected AKAs with AKAs presented to obtain
  871.             'addresses recognised at this site.
  872.  
  873.             IF Word$(3) = "SysOp:" THEN
  874.                PRINT #FDStatOut, "                     SysOp:  "; MID$(LineBuffer$, 20, LEN(LineBuffer$))
  875.               
  876.                FOR MaxAKATest = 0 TO MaxAKA             '1.65c - Set MaxAKATest
  877.                    IF AKAStr(MaxAKATest) = "" THEN        'to number of presented
  878.                       MaxAKATest = MaxAKATest - 1       'AKAs for speedy testing
  879.                       EXIT FOR                          'against Unexpected
  880.                    END IF                               'passwords.   <--+
  881.                NEXT                                     '                |
  882.                
  883.                FOR MaxUnexPassTest = 0 TO MaxUnexPass             '1.65c - Set MaxUnexPassTest
  884.                    IF AKAStr(MaxUnexPassTest) = "" THEN             'to number of presented
  885.                       MaxUnexPassTest = MaxUnexPassTest - 1       'Unexpected passwords for
  886.                       EXIT FOR                                    'speedy testing against AKAs
  887.                    END IF
  888.                NEXT
  889.                    
  890.                FOR AKATest = 0 TO MaxAKATest
  891.                    FOR UnexPassTest = 0 TO MaxUnexPassTest
  892.                        'AKA are shown as "AKA: <Node>, <Node>, <Node> therefore testing
  893.                        'must account for comma as part of the word.
  894.                        IF RIGHT$(AKAStr(AKATest), 1) = "," THEN AKAStr(AKATest) = LEFT$(AKAStr(AKATest), LEN(AKAStr(AKATest)) - 1)
  895.                        IF AKAStr(AKATest) = UnexPass(UnexPassTest) THEN
  896.                           AKAStr(AKATest) = ""
  897.                        END IF
  898.                    NEXT UnexPassTest
  899.                NEXT AKATest
  900.                IF AKAStr(1) <> "" THEN
  901.                   PRINT #FDStatOut, "                     AKAs:   ";
  902.                   AKALine = 0
  903.                   FOR AKATest = 1 TO MaxAKA
  904.                       IF AKAStr(AKATest) <> "" THEN
  905.                          IF AKALine MOD 4 = 0 AND AKALine <> 0 THEN
  906.                             PRINT #FDStatOut,
  907.                             PRINT #FDStatOut, "                             ";
  908.                          END IF
  909.                          PRINT #FDStatOut, AKAStr(AKATest); " ";
  910.                          AKALine = AKALine + 1
  911.                       END IF
  912.                   NEXT
  913.                   PRINT
  914.                   PRINT #FDStatOut,
  915.                END IF
  916.             END IF
  917.  
  918.             '**********  Poller Sent Files ***********************
  919.             IF Word$(3) = "Sent" THEN
  920.                
  921.                ' Process Amount, Bytes & CPS Rate per Baud if Send completed
  922.  
  923.                IF Word$(6) <> "(incomplete)" THEN
  924.                   Bytes = VAL(Word$(5))
  925.                   CPS = VAL(Word$(6))
  926.                   IF CPS <> 0 THEN
  927.                      Secs = Bytes / CPS
  928.                   ELSE
  929.                      Secs = 1
  930.                   END IF
  931.                   FilesOutBytesTotal(ConnPoll) = FilesOutBytesTotal(ConnPoll) + Bytes
  932.                   FilesOutSecs(ConnPoll) = FilesOutSecs(ConnPoll) + Secs
  933.                  
  934.                   FilesOutTotal = FilesOutTotal + 1
  935.                   FilesOutBytesTotal = FilesOutBytesTotal + Bytes
  936.                   FilesOutBytesSession = FilesOutBytesSession + Bytes
  937.                   FilesOutSecsSession = FilesOutSecsSession + Secs
  938.                   IF FilesOutSecsSession <> 0 THEN FilesOutCPSSession = INT(FilesOutBytesSession / FilesOutSecsSession)
  939.                   
  940.                   IF FilesOutSecs(ConnPoll) <> 0 THEN FilesOutCPS(ConnPoll) = FilesOutBytesTotal(ConnPoll) / FilesOutSecs(ConnPoll)
  941.                   FilesOut(ConnPoll) = FilesOut(ConnPoll) + 1
  942.                   LOCATE FilesRow%(ConnPoll), FilesOutKbCol%(ConnPoll)
  943.                   KbOut = (FilesOutBytesTotal(ConnPoll) / 1024)
  944.                   IF KbOut < 9999 THEN PRINT USING "####"; KbOut
  945.                   IF KbOut > 9999 AND KbOut < 99999 THEN PRINT USING "##.#"; KbOut / 1024; : COLOR 15, 0: PRINT "M"
  946.                   IF KbOut > 99999 AND KbOut < 999999 THEN PRINT USING "###"; KbOut / 1024; : COLOR 15, 0: PRINT "M"
  947.                   IF KbOut > 999999 AND KbOut < 9999999 THEN PRINT USING "####"; KbOut / 1024; : COLOR 15, 0: PRINT "M"
  948.                   IF KbOut > 9999999 AND KbOut < 99999999 THEN PRINT USING "##.#"; (KbOut / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  949.                   IF KbOut > 99999999 AND KbOut < 999999999 THEN PRINT USING "###"; (KbOut / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  950.                   IF KbOut > 999999999 AND KbOut < 9999999999# THEN PRINT USING "####"; (KbOut / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  951.                   IF KbOut > 9999999999# THEN PRINT "*****"
  952.                   COLOR FieldsFore, FieldsBack
  953.                   LOCATE FilesRow%(ConnPoll), FilesOutCPSCol%(ConnPoll)
  954.                   IF FilesOutCPS(ConnPoll) <> 0 THEN PRINT USING "####"; FilesOutCPS(ConnPoll)
  955.                END IF
  956.  
  957.                ' increment 'Other' files and then decrement if it is a TIC
  958.                ' ??# (ie WE3) or PKT.
  959.                
  960.                FilesOutOther = FilesOutOther + 1
  961.                EXT$ = RIGHT$(Word$(4), 4)
  962.                EXT$ = LEFT$(EXT$, 3)
  963.                IF LEFT$(EXT$, 2) = "SU" OR LEFT$(EXT$, 2) = "MO" OR LEFT$(EXT$, 2) = "TU" OR LEFT$(EXT$, 2) = "WE" OR LEFT$(EXT$, 2) = "TH" OR LEFT$(EXT$, 2) = "FR" OR LEFT$(EXT$, 2) = "SA" THEN
  964.                   IF RIGHT$(EXT$, 1) = "0" OR RIGHT$(EXT$, 1) = "1" OR RIGHT$(EXT$, 1) = "2" OR RIGHT$(EXT$, 1) = "3" OR RIGHT$(EXT$, 1) = "4" OR RIGHT$(EXT$, 1) = "5" OR RIGHT$(EXT$, 1) = "6" OR RIGHT$(EXT$, 1) = "7" OR RIGHT$(EXT$, 1) = "8" OR  _
  965. RIGHT$(EXT$, 1) = "9" THEN
  966.                      FilesOutDDN = FilesOutDDN + 1
  967.                      FilesOutOther = FilesOutOther - 1
  968.                      LOCATE 16, 49
  969.                      COLOR 2, 0
  970.                      IF FilesOutDDN < 1000 THEN
  971.                         PRINT USING "###"; FilesOutDDN
  972.                      ELSE
  973.                         PRINT USING "####"; FilesOutDDN
  974.                      END IF
  975.                      COLOR FieldsFore, FieldsBack
  976.                   ELSE
  977.                      PRINT #FDStatOut, SPACE$(21); "File:   "; Word$(3); " "; Word$(4); " "; LEFT$(Word$(5), LEN(Word$(5)) - 1)
  978.                   END IF
  979.                ELSE
  980.                   IF EXT$ <> "PKT" AND EXT$ <> "TIC" AND EXT$ <> "REQ" THEN PRINT #FDStatOut, SPACE$(21); "File:   "; Word$(3); " "; Word$(4); " "; LEFT$(Word$(5), LEN(Word$(5)) - 1)
  981.                END IF
  982.  
  983.                IF EXT$ = "PKT" THEN
  984.                   FilesOutPKT = FilesOutPKT + 1
  985.                   FilesOutOther = FilesOutOther - 1
  986.                   LOCATE 16, 57
  987.                   COLOR 2, 0
  988.                  'PRINT USING "###"; FilesOutPKT
  989.                   IF FilesOutPKT < 1000 THEN
  990.                      PRINT USING "###"; FilesOutPKT
  991.                   ELSE
  992.                      PRINT USING "####"; FilesOutPKT
  993.                   END IF
  994.                   COLOR FieldsFore, FieldsBack
  995.                END IF
  996.            
  997.                IF EXT$ = "TIC" THEN
  998.                   FilesOutTIC = FilesOutTIC + 1
  999.                   FilesOutOther = FilesOutOther - 1
  1000.                   LOCATE 16, 65
  1001.                   COLOR 2, 0
  1002.                   'PRINT USING "###"; FilesOutTIC
  1003.                   IF FilesOutTIC < 1000 THEN
  1004.                      PRINT USING "###"; FilesOutTIC
  1005.                   ELSE
  1006.                      PRINT USING "####"; FilesOutTIC
  1007.                   END IF
  1008.                   COLOR FieldsFore, FieldsBack
  1009.                END IF
  1010.           
  1011.                LOCATE 16, 75
  1012.                COLOR 2, 0
  1013.                IF FilesOutOther <> 0 THEN
  1014.                   IF FilesOutOther < 1000 THEN
  1015.                      PRINT USING "###"; FilesOutOther
  1016.                   ELSE
  1017.                      PRINT USING "####"; FilesOutOther
  1018.                   END IF
  1019.                   COLOR FieldsFore, FieldsBack
  1020.                END IF
  1021.             END IF
  1022.            
  1023.            ' '*** File Sending aborted by Remote Pollee ***
  1024.            '
  1025.            ' IF MID$(LineBuffer$, 13, 27) = "Receiver requested to skip " THEN
  1026.            '    FileOutError = FileOutError + 1
  1027.            '    PRINT #FDStatOut, "               Note: "; MID$(LineBuffer$, 13)
  1028.            ' END IF
  1029.            
  1030.             '*********** Poller Recieved files ******************************
  1031.            
  1032.             'Freq'ed files
  1033.             IF Word$(3) = "FREQ:" THEN PRINT #FDStatOut, "                     "; Word$(3); "   "; Word$(4)
  1034.            
  1035.             IF Word$(3) = "Rcvd" THEN
  1036.                
  1037.                ' Process Amount, Bytes & CPS Rate per Baud if Send completed
  1038.  
  1039.                IF Word$(6) <> "(incomplete)" THEN
  1040.                   
  1041.                   Bytes = VAL(Word$(5))
  1042.                   CPS = VAL(Word$(6))
  1043.                   IF CPS <> 0 THEN
  1044.                      Secs = Bytes / CPS
  1045.                   ELSE
  1046.                      Secs = 1
  1047.                   END IF
  1048.                   FilesInBytesTotal(ConnPoll) = FilesInBytesTotal(ConnPoll) + Bytes
  1049.                   FilesInSecs(ConnPoll) = FilesInSecs(ConnPoll) + Secs
  1050.                  
  1051.                   FilesInTotal = FilesInTotal + 1
  1052.                   FilesInBytesTotal = FilesInBytesTotal + Bytes
  1053.                   FilesInBytesSession = FilesInBytesSession + Bytes
  1054.                   FilesInSecsSession = FilesInSecsSession + Secs
  1055.                   IF FilesInSecsSession <> 0 THEN FilesInCPSSession = INT(FilesInBytesSession / FilesInSecsSession)
  1056.                  
  1057.                   IF FilesInSecs(ConnPoll) <> 0 THEN FilesInCPS(ConnPoll) = FilesInBytesTotal(ConnPoll) / FilesInSecs(ConnPoll)
  1058.                   FilesIn(ConnPoll) = FilesIn(ConnPoll) + 1
  1059.                   LOCATE FilesRow%(ConnPoll), FilesInKbCol%(ConnPoll)
  1060.                   'PRINT USING "####"; (FilesInBytesTotal(ConnPoll) / 1024)
  1061.                   KbIn = (FilesInBytesTotal(ConnPoll) / 1024)
  1062.                   IF KbIn < 9999 THEN PRINT USING "####"; KbIn
  1063.                   IF KbIn > 9999 AND KbIn < 99999 THEN PRINT USING "##.#"; KbIn / 1024; : COLOR 15, 0: PRINT "M"
  1064.                   IF KbIn > 99999 AND KbIn < 999999 THEN PRINT USING "###"; KbIn / 1024; : COLOR 15, 0: PRINT "M"
  1065.                   IF KbIn > 999999 AND KbIn < 9999999 THEN PRINT USING "####"; KbIn / 1024; : COLOR 15, 0: PRINT "M"
  1066.                   IF KbIn > 9999999 AND KbIn < 99999999 THEN PRINT USING "##.#"; (KbIn / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  1067.                   IF KbIn > 99999999 AND KbIn < 999999999 THEN PRINT USING "###"; (KbIn / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  1068.                   IF KbIn > 999999999 AND KbIn < 9999999999# THEN PRINT USING "####"; (KbIn / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  1069.                   IF KbIn > 9999999999# THEN PRINT "*****"
  1070.                   COLOR FieldsFore, FieldsBack
  1071.                   LOCATE FilesRow%(ConnPoll), FilesInCPSCol%(ConnPoll)
  1072.                   IF FilesInCPS(ConnPoll) <> 0 THEN PRINT USING "####"; FilesInCPS(ConnPoll)
  1073.                END IF
  1074.  
  1075.                ' increment 'Other' files and then decrement if it is a TIC
  1076.                ' ??# (ie WE3) or PKT.
  1077.  
  1078.                FilesInOther = FilesInOther + 1
  1079.                EXT$ = RIGHT$(Word$(4), 4)
  1080.                EXT$ = LEFT$(EXT$, 3)
  1081.                IF LEFT$(EXT$, 2) = "SU" OR LEFT$(EXT$, 2) = "MO" OR LEFT$(EXT$, 2) = "TU" OR LEFT$(EXT$, 2) = "WE" OR LEFT$(EXT$, 2) = "TH" OR LEFT$(EXT$, 2) = "FR" OR LEFT$(EXT$, 2) = "SA" THEN
  1082.                   IF RIGHT$(EXT$, 1) = "0" OR RIGHT$(EXT$, 1) = "1" OR RIGHT$(EXT$, 1) = "2" OR RIGHT$(EXT$, 1) = "3" OR RIGHT$(EXT$, 1) = "4" OR RIGHT$(EXT$, 1) = "5" OR RIGHT$(EXT$, 1) = "6" OR RIGHT$(EXT$, 1) = "7" OR RIGHT$(EXT$, 1) = "8" OR  _
  1083. RIGHT$(EXT$, 1) = "9" THEN
  1084.                      FilesInDDN = FilesInDDN + 1
  1085.                      FilesInOther = FilesInOther - 1
  1086.                      LOCATE 17, 49
  1087.                      COLOR 2, 0
  1088.                      'PRINT USING "###"; FilesInDDN
  1089.                      IF FilesInDDN < 1000 THEN
  1090.                         PRINT USING "###"; FilesInDDN
  1091.                      ELSE
  1092.                         PRINT USING "####"; FilesInDDN
  1093.                      END IF
  1094.                      COLOR FieldsFore, FieldsBack
  1095.                   ELSE
  1096.                      PRINT #FDStatOut, SPACE$(21); "File:   "; Word$(3); " "; Word$(4); " "; LEFT$(Word$(5), LEN(Word$(5)) - 1)
  1097.                   END IF
  1098.                ELSE
  1099.                   IF EXT$ <> "PKT" AND EXT$ <> "TIC" AND EXT$ <> "REQ" THEN PRINT #FDStatOut, SPACE$(21); "File:   "; Word$(3); " "; Word$(4); " "; LEFT$(Word$(5), LEN(Word$(5)) - 1)
  1100.                END IF
  1101.           
  1102.                IF EXT$ = "PKT" THEN
  1103.                   FilesInPKT = FilesInPKT + 1
  1104.                   FilesInOther = FilesInOther - 1
  1105.                   LOCATE 17, 57
  1106.                   COLOR 2, 0
  1107.                   'PRINT USING "###"; FilesInPKT
  1108.                   IF FilesInPKT < 1000 THEN
  1109.                      PRINT USING "###"; FilesInPKT
  1110.                   ELSE
  1111.                      PRINT USING "####"; FilesInPKT
  1112.                   END IF
  1113.                   COLOR FieldsFore, FieldsBack
  1114.                END IF
  1115.           
  1116.                IF EXT$ = "TIC" THEN
  1117.                   FilesInTIC = FilesInTIC + 1
  1118.                   FilesInOther = FilesInOther - 1
  1119.                   LOCATE 17, 65
  1120.                   COLOR 2, 0
  1121.                   'PRINT USING "###"; FilesInTIC
  1122.                   IF FilesInTIC < 1000 THEN
  1123.                      PRINT USING "###"; FilesInTIC
  1124.                   ELSE
  1125.                      PRINT USING "####"; FilesInTIC
  1126.                   END IF
  1127.                   COLOR FieldsFore, FieldsBack
  1128.                END IF
  1129.        
  1130.                LOCATE 17, 75
  1131.                COLOR 2, 0
  1132.                IF FilesInOther <> 0 THEN
  1133.                   IF FilesInOther < 1000 THEN
  1134.                      PRINT USING "###"; FilesInOther
  1135.                   ELSE
  1136.                      PRINT USING "####"; FilesInOther
  1137.                   END IF
  1138.                   COLOR FieldsFore, FieldsBack
  1139.                END IF
  1140.            
  1141.             END IF
  1142.             
  1143.             GOSUB FDLine
  1144.        
  1145.          LOOP
  1146.         
  1147.          IF INSTR(Word$(5), ":") THEN
  1148.            
  1149.             IF FilesOutBytesSession < 10240 THEN
  1150.                Sent$ = RTRIM$(STR$(FilesOutBytesSession)) + "b"
  1151.             ELSE
  1152.                Sent$ = RTRIM$(STR$(INT(FilesOutBytesSession / 1024))) + "kb"
  1153.             END IF
  1154.           
  1155.             IF FilesInBytesSession < 10240 THEN
  1156.                Rcvd$ = RTRIM$(STR$(FilesInBytesSession)) + "b"
  1157.             ELSE
  1158.                Rcvd$ = RTRIM$(STR$(INT(FilesInBytesSession / 1024))) + "kb"
  1159.             END IF
  1160.             
  1161.             PRINT #FDStatOut, "                     Trans:  Sent"; Sent$; " at"; FilesOutCPSSession; "cps / Rcvd"; Rcvd$; " at"; FilesInCPSSession; "cps."
  1162.             PRINT #FDStatOut, "                     Online: "; Word$(5); " Cost: "; Word$(6)
  1163.             TotalCost = TotalCost + VAL(Word$(6))
  1164.             COLOR 2, 0
  1165.             LOCATE 18, 72
  1166.             IF TotalCost > 0 THEN
  1167.                IF TotalCost < 99999 THEN
  1168.                   PRINT USING "###.##"; (TotalCost / 100)
  1169.                ELSE
  1170.                   IF TotalCost < 99999900 THEN
  1171.                       PRINT USING "######"; (TotalCost / 100)
  1172.                   ELSE
  1173.                       PRINT "******"
  1174.                   END IF
  1175.                END IF
  1176.             END IF
  1177.          ELSE
  1178.             'PRINT #FDStatOut, "                     whilst connected to poller"; PollingBBS$
  1179.          END IF
  1180.          BBSNameFound = 0
  1181.          PrtConn = 0
  1182.          UnexPass = 0
  1183.          UnexPassTest = 0
  1184.          ERASE UnexPass
  1185.          ERASE AKAStr
  1186.          InString = 0
  1187.          PollingBBS$ = " <Unknown> "
  1188.  
  1189.          ' ****** End Poller Processing ********************
  1190.          
  1191.       END IF
  1192.    END IF
  1193. ELSE
  1194.  
  1195.    ' If RING and then "NO CARRIER" found in FD.LOG then assume Human Caller...
  1196.  
  1197.    IF Word$(3) = "NO" AND Word$(4) = "CARRIER" THEN
  1198.       CommentFail$ = " then NO CARRIER"
  1199.       'GOTO ConnInFail
  1200.    END IF
  1201.   
  1202.    'IF Word$(3) <> "CONNECT" AND (Word$(1) = "=" OR Word$(1) = "!" OR Word$(1) = "" OR Word$(1) = "-" OR Word$(3) = "Calling" OR (Word$(3) = "Preparing" AND Word$(4) = "outbound" AND Word$(5) = "mail")) THEN
  1203.    '   GOTO ConnInFail
  1204.    'END IF
  1205.   
  1206.    'IF Word$(1) = "=" OR Word$(1) = "" OR Word$(3) = "Calling" THEN RETURN
  1207.    'HumanInFailed = HumanInFailed + 1
  1208.    'LOCATE 21, 29
  1209.    'COLOR 12, 0
  1210.    'PRINT USING "####"; HumanInFailed
  1211.    'COLOR FieldsFore, FieldsBack
  1212.  
  1213.    GOTO ConnInFail
  1214.  
  1215. END IF
  1216. RETURN
  1217.  
  1218. '---------------------------------------------------------------------------
  1219. ' Calls/Polls initiated by this FrontDoor Mailer to be processed.
  1220. '---------------------------------------------------------------------------
  1221. Calling:
  1222.  
  1223.    'Memorizing BBS Name we are Calling in case we fail to connect. So that
  1224.    'it can be reported in our FDStat Log (FDSTAT.LOG)
  1225.  
  1226. InsidePoll = -1
  1227. PollingBBS$ = ""
  1228. FOR n = 4 TO 30
  1229.     IF Word$(n) <> "" THEN
  1230.        PollingBBS$ = PollingBBS$ + " " + Word$(n)
  1231.     ELSE
  1232.        PollingBBS$ = LEFT$(PollingBBS$, LEN(PollingBBS$) - (LEN(Word$(n - 1)) + 2))
  1233.        EXIT FOR
  1234.     END IF
  1235. NEXT
  1236. PRINT #FDStatOut,
  1237. PRINT #FDStatOut, LEFT$(LineBuffer$, 10); "  Polling:"; PollingBBS$; ", ";
  1238.  
  1239. AKA = 1
  1240.  
  1241. GOSUB FDLine
  1242.  
  1243. 'If modem produces RINGING then get next line and check for CONNECT
  1244.  
  1245. ringing:
  1246. IF Word$(3) = "RINGING" OR Word$(3) = "DFRS:" THEN
  1247.    GOSUB FDLine
  1248.    GOTO ringing
  1249. END IF
  1250.  
  1251. ' Get CONNECT baud Rate
  1252.  
  1253. IF Word$(3) = "CONNECT" THEN
  1254.   IF VAL(LEFT$(Word$(4), 5)) >= 0 THEN ConnPoll = 1
  1255.   IF VAL(LEFT$(Word$(4), 5)) >= 4800 THEN ConnPoll = 2
  1256.   IF VAL(LEFT$(Word$(4), 5)) >= 7200 THEN ConnPoll = 3
  1257.   IF VAL(LEFT$(Word$(4), 5)) >= 9600 THEN ConnPoll = 4
  1258.   IF VAL(LEFT$(Word$(4), 6)) >= 12000 THEN ConnPoll = 5
  1259.   IF VAL(LEFT$(Word$(4), 6)) >= 14400 THEN ConnPoll = 6
  1260.   IF VAL(LEFT$(Word$(4), 6)) >= 16800 THEN ConnPoll = 7
  1261.   IF VAL(LEFT$(Word$(4), 6)) >= 19200 THEN ConnPoll = 8
  1262.   IF VAL(LEFT$(Word$(4), 6)) >= 21600 THEN ConnPoll = 9
  1263.   IF VAL(LEFT$(Word$(4), 6)) >= 24000 THEN ConnPoll = 10
  1264.   IF VAL(LEFT$(Word$(4), 6)) >= 26400 THEN ConnPoll = 11
  1265.   IF VAL(LEFT$(Word$(4), 6)) >= 28800 THEN ConnPoll = 12
  1266.   IF VAL(LEFT$(Word$(4), 6)) >= 31200 THEN ConnPoll = 13
  1267.   IF VAL(LEFT$(Word$(4), 6)) >= 33600 THEN ConnPoll = 14
  1268.   IF VAL(LEFT$(Word$(4), 4)) >= 300 THEN ConnHuman = 1
  1269.   IF VAL(LEFT$(Word$(4), 5)) >= 1200 THEN ConnHuman = 2
  1270.   IF VAL(LEFT$(Word$(4), 5)) >= 2400 THEN ConnHuman = 3
  1271.   IF VAL(LEFT$(Word$(4), 5)) >= 4800 THEN ConnHuman = 4
  1272.   IF VAL(LEFT$(Word$(4), 5)) >= 7200 THEN ConnHuman = 5
  1273.   IF VAL(LEFT$(Word$(4), 5)) >= 9600 THEN ConnHuman = 6
  1274.   IF VAL(LEFT$(Word$(4), 6)) >= 12000 THEN ConnHuman = 7
  1275.   IF VAL(LEFT$(Word$(4), 6)) >= 14400 THEN ConnHuman = 8
  1276.   IF VAL(LEFT$(Word$(4), 6)) >= 16800 THEN ConnHuman = 9
  1277.   IF VAL(LEFT$(Word$(4), 6)) >= 19200 THEN ConnHuman = 10
  1278.   IF VAL(LEFT$(Word$(4), 6)) >= 21600 THEN ConnHuman = 11
  1279.   IF VAL(LEFT$(Word$(4), 6)) >= 24000 THEN ConnHuman = 12
  1280.   IF VAL(LEFT$(Word$(4), 6)) >= 26400 THEN ConnHuman = 13
  1281.   IF VAL(LEFT$(Word$(4), 6)) >= 28800 THEN ConnHuman = 14
  1282.   IF VAL(LEFT$(Word$(4), 6)) >= 31200 THEN ConnHuman = 15
  1283.   IF VAL(LEFT$(Word$(4), 6)) >= 33600 THEN ConnHuman = 16
  1284.   
  1285.   'IF ConnHuman >= 9 THEN FieldsFore = 2 ELSE FieldsFore = 3
  1286.  
  1287.    ConnPoll$ = Word$(4) + " " + Word$(5) + " " + Word$(6) + " " + Word$(7)
  1288.    ConnBaud = 1
  1289.    GOSUB FDLine
  1290.           
  1291.    '******  Process Computer Connection (ConnPoll) *********************
  1292.         
  1293.    IF PrtConn = 0 THEN
  1294.       PRINT #FDStatOut, RTRIM$(ConnPoll$)
  1295.       PrtConn = 1
  1296.    END IF
  1297.  
  1298.    ConnOutComp(ConnPoll) = ConnOutComp(ConnPoll) + 1
  1299.    LOCATE ConnOutCompRow%(ConnPoll), ConnOutCompCol%(ConnPoll)
  1300.    PRINT USING "###"; ConnOutComp(ConnPoll)
  1301.  
  1302.    DO
  1303.       'Test if we lost connection!
  1304.       IF (Word$(3) = "Calling" AND INSTR(LineBuffer$, ",") > 1 AND INSTR(LineBuffer$, ":") > 1 AND INSTR(LineBuffer$, "/") > 1) OR (Word$(1) = "+" AND Word$(3) = "RING") OR (Word$(1) = "----------") OR (Word$(3) = "Event" AND MID$(Word$(4), 2, 1) =  _
  1305. "-") THEN
  1306.                NoLineGet = 1
  1307.                ConnOutFailed = ConnOutFailed + 1
  1308.                LOCATE 21, 50
  1309.                COLOR 12, 0
  1310.                PRINT USING "####"; ConnOutFailed
  1311.                COLOR FieldsFore, FILELDSBACK
  1312.                LOCATE 24, 1
  1313.                PRINT "                                                                                ";
  1314.                LOCATE 24, 1
  1315.                COLOR 12, 0
  1316.                PRINT DateCurrent$; SPACE$(11 - LEN(TimeCurrent$)); TimeCurrent$; "  > Poll ended abnormally! <";
  1317.                PRINT #FDStatOut, "              ERROR: > Poll ended abnormally! <"
  1318.                IF Beeps = 1 THEN BEEP
  1319.                IF Pause = 1 THEN
  1320.                   PressEnter Pause, Beeps
  1321.                END IF
  1322.          EXIT DO
  1323.       END IF
  1324.  
  1325.   
  1326.       'Constantly Process computer connection data until
  1327.       ' "From <Node>, <Time>, <Cost>" encountered indicating end of poll info.
  1328.    
  1329.             IF Word$(3) = "To" THEN
  1330.                COLOR 2, 0
  1331.                TimeOutPollersSecs = TimeOutPollersSecs + (VAL(RIGHT$(Word$(5), 3)) + 60 * VAL(Word$(5)))
  1332.                DO WHILE TimeOutPollersSecs > 59
  1333.                   TimeOutPollersMins = TimeOutPollersMins + 1
  1334.                   TimeOutPollersSecs = TimeOutPollersSecs - 60
  1335.                LOOP
  1336.                LOCATE 18, 64
  1337.                PRINT USING "###"; TimeOutPollersMins
  1338.                LOCATE 18, 67: PRINT ":";
  1339.                LOCATE 18, 68
  1340.                IF TimeOutPollersSecs > 9 THEN
  1341.                   PRINT USING "##"; TimeOutPollersSecs
  1342.                ELSE
  1343.                   PRINT "0"; LTRIM$(STR$(TimeOutPollersSecs))
  1344.                END IF
  1345.                EXIT DO       'Exit the Major Do for Polling/Poller processing.
  1346.             END IF
  1347.            
  1348.             DO WHILE Word$(3) = "Unexpected" AND Word$(4) = "password,"
  1349.                UnexPass = UnexPass + 1
  1350.                UnexPass(UnexPass) = Word$(7)
  1351.                GOSUB FDLine
  1352.             LOOP
  1353.            
  1354.             IF Word$(3) = "Password" AND Word$(4) = "error:" THEN
  1355.                ErrorPassword = ErrorPassword + 1
  1356.                ErrorOther = ErrorOther - 1
  1357.                LOCATE 20, 75
  1358.                COLOR 12, 0
  1359.                PRINT USING "###"; ErrorPassword
  1360.                COLOR FieldsFore, FieldsBack
  1361.             END IF
  1362.            
  1363.             IF Word$(3) = "Session" AND Word$(4) = "handshake" AND Word$(5) = "failure" THEN
  1364.                ConnOutFailed = ConnOutFailed + 1
  1365.                ErrorOther = ErrorOther - 1
  1366.                LOCATE 21, 50
  1367.                COLOR 12, 0
  1368.                PRINT USING "####"; ConnOutFailed
  1369.                COLOR FieldsFore, FieldsBack
  1370.             END IF
  1371.            
  1372.             IF Word$(1) = "?" OR (Word$(3) = "Terminating" AND Word$(4) = "call") THEN
  1373.                COLOR 12, 0
  1374.                ErrorOther = ErrorOther + 1
  1375.               
  1376.                ' Process Sent incomplete error
  1377.            
  1378.                IF Word$(6) = "(incomplete)" THEN
  1379.                   IF Word$(3) = "Send" THEN FileOutError = FileOutError + 1
  1380.                   IF Word$(3) = "Rcvd" THEN FileInError = FileInError + 1
  1381.                   ErrorOther = ErrorOther - 1
  1382.                   LOCATE 21, 64
  1383.                   IF FileOutError > 0 THEN PRINT USING "###"; FileOutError
  1384.                   LOCATE 20, 64
  1385.                   IF FileInError > 0 THEN PRINT USING "###"; FileInError
  1386.                END IF
  1387.  
  1388.                LOCATE 21, 75
  1389.                IF ErrorOther <> 0 THEN PRINT USING "###"; ErrorOther
  1390.               
  1391.                'Print error except for passwords in password error
  1392.                IF Word$(3) = "Password" AND Word$(4) = "error:" THEN
  1393.                   PRINT #FDStatOut, LEFT$(LineBuffer$, 12); "  ERROR: Password error from "; Word$(10)
  1394.                ELSE
  1395.                   PRINT #FDStatOut, LEFT$(LineBuffer$, 12); "  ERROR: "; MID$(LineBuffer$, 13, LEN(LineBuffer$) - 12)
  1396.                END IF
  1397.              
  1398.                LOCATE 24, 1
  1399.                PRINT "                                                                                ";
  1400.                LOCATE 24, 1
  1401.                COLOR 12, 0
  1402.                PRINT DateCurrent$; " "; LEFT$(LineBuffer$, 65);
  1403.                IF Beeps = 1 THEN BEEP
  1404.                IF Pause = 1 THEN
  1405.                   PressEnter Pause, Beeps
  1406.                END IF
  1407.               
  1408.                'Session handshake failure
  1409.                IF Word$(3) = "Session" AND Word$(4) = "handshake" AND Word$(5) = "failure" THEN
  1410.                   'PRINT #FDStatOut,
  1411.                   BBSNameFound = 0
  1412.                   PrtConn = 0
  1413.                   UnexPass = 0
  1414.                   UnexPassTest = 0
  1415.                   ERASE UnexPass
  1416.                   ERASE AKAStr
  1417.                   InString = 0
  1418.                   PollingBBS$ = " <Unknown> "
  1419.                   RETURN
  1420.                   'EXIT DO
  1421.                END IF
  1422.             END IF
  1423.             
  1424.             IF BBSNameFound = 0 AND Word$(1) = "+" THEN
  1425.            
  1426.                BBSNameFound = 1
  1427.            
  1428.                'Obtain Main Address from <The BBS Name>, <Main Address>
  1429.            
  1430.                DO WHILE AKAStr(0) = ""
  1431.                   InString = InString + 1
  1432.                   IF Word$(InString) = "" THEN EXIT DO
  1433.                   IF INSTR(Word$(InString), "/") > 0 AND INSTR(Word$(InString), ":") > 0 THEN
  1434.                      AKAStr(0) = Word$(InString)
  1435.                   END IF
  1436.                LOOP
  1437.             END IF
  1438.         
  1439.             'Get Other AKAs
  1440.  
  1441.             IF Word$(3) = "AKA:" THEN
  1442.                AKAStr(AKA) = Word$(4)
  1443.                AKAStr(AKA + 1) = Word$(5)
  1444.                AKAStr(AKA + 2) = Word$(6)
  1445.                AKA = AKA + 3
  1446.             END IF
  1447.         
  1448.             'Compare Unexpected AKAs with AKAs presented to obtain
  1449.             'addresses recognised at this site.
  1450.  
  1451.             IF Word$(3) = "SysOp:" THEN
  1452.                PRINT #FDStatOut, "                     SysOp:  "; MID$(LineBuffer$, 20, LEN(LineBuffer$))
  1453.               
  1454.                FOR MaxAKATest = 0 TO MaxAKA             '1.65c - Set MaxAKATest
  1455.                    IF AKAStr(MaxAKATest) = "" THEN        'to number of presented
  1456.                       MaxAKATest = MaxAKATest - 1       'AKAs for speedy testing
  1457.                       EXIT FOR                          'against Unexpected
  1458.                    END IF                               'passwords.   <--+
  1459.                NEXT                                     '                |
  1460.                FOR MaxUnexPassTest = 0 TO MaxUnexPass             '1.65c - Set MaxUnexPassTest
  1461.                    IF AKAStr(MaxUnexPassTest) = "" THEN             'to number of presented
  1462.                       MaxUnexPassTest = MaxUnexPassTest - 1       'Unexpected passwords for
  1463.                       EXIT FOR                                    'speedy testing against AKAs
  1464.                    END IF
  1465.                NEXT
  1466.               
  1467.                FOR AKATest = 0 TO MaxAKATest
  1468.                    FOR UnexPassTest = 0 TO MaxUnexPassTest
  1469.                        'AKA are shown as "AKA: <Node>, <Node>, <Node> therefore testing
  1470.                        'must account for comma as part of the word.
  1471.                        IF RIGHT$(AKAStr(AKATest), 1) = "," THEN AKAStr(AKATest) = LEFT$(AKAStr(AKATest), LEN(AKAStr(AKATest)) - 1)
  1472.                        IF AKAStr(AKATest) = UnexPass(UnexPassTest) THEN
  1473.                           AKAStr(AKATest) = ""
  1474.                        END IF
  1475.                    NEXT
  1476.                NEXT
  1477.                IF AKAStr(1) <> "" THEN
  1478.                   PRINT #FDStatOut, "                     AKAs:   ";
  1479.                   AKALine = 0
  1480.                   FOR AKATest = 1 TO MaxAKA
  1481.                       IF AKAStr(AKATest) <> "" THEN
  1482.                          IF AKALine MOD 4 = 0 AND AKALine <> 0 THEN
  1483.                             PRINT #FDStatOut,
  1484.                             PRINT #FDStatOut, "                             ";
  1485.                          END IF
  1486.                          PRINT #FDStatOut, AKAStr(AKATest); " ";
  1487.                          AKALine = AKALine + 1
  1488.                       END IF
  1489.                   NEXT
  1490.                   PRINT
  1491.                   PRINT #FDStatOut,
  1492.                END IF
  1493.             END IF
  1494.  
  1495.             '************ Calling/Polling Files sent ***********************
  1496.  
  1497.             IF Word$(3) = "Sent" THEN
  1498.  
  1499.                ' Process Sent incomplete error
  1500.             
  1501.                IF Word$(6) = "(incomplete)" THEN
  1502.                   FileOutError = FileOutError + 1
  1503.                   ErrorOther = ErrorOther - 1
  1504.                   LOCATE 21, 64
  1505.                   PRINT USING "###"; FileOutError
  1506.                END IF
  1507.  
  1508.                ' Process Amount, Bytes & CPS Rate per Baud if Send completed
  1509.  
  1510.                IF Word$(6) <> "(incomplete)" THEN
  1511. '                 Bytes = VAL(LEFT$(Word$(5), LEN(Word$(5)) - 1))
  1512.                   Bytes = VAL(Word$(5))
  1513.                   CPS = VAL(Word$(6))
  1514.                   IF CPS <> 0 THEN
  1515.                      Secs = Bytes / CPS
  1516.                   ELSE
  1517.                      Secs = 1
  1518.                   END IF
  1519.                   FilesOutBytesTotal(ConnPoll) = FilesOutBytesTotal(ConnPoll) + Bytes
  1520.                   FilesOutSecs(ConnPoll) = FilesOutSecs(ConnPoll) + Secs
  1521.                 
  1522.                   FilesOutTotal = FilesOutTotal + 1
  1523.                   FilesOutBytesTotal = FilesOutBytesTotal + Bytes
  1524.                   FilesOutBytesSession = FilesOutBytesSession + Bytes
  1525.                   FilesOutSecsSession = FilesOutSecsSession + Secs
  1526.                   IF FilesOutSecsSession <> 0 THEN FilesOutCPSSession = INT(FilesOutBytesSession / FilesOutSecsSession)
  1527.                
  1528.                   IF FilesOutSecs(ConnPoll) <> 0 THEN FilesOutCPS(ConnPoll) = FilesOutBytesTotal(ConnPoll) / FilesOutSecs(ConnPoll)
  1529.                   FilesOut(ConnPoll) = FilesOut(ConnPoll) + 1
  1530.                   LOCATE FilesRow%(ConnPoll), FilesOutKbCol%(ConnPoll)
  1531.                   'PRINT USING "####"; (FilesOutBytesTotal(ConnPoll) / 1024)
  1532.                   KbOut = (FilesOutBytesTotal(ConnPoll) / 1024)
  1533.                   IF KbOut < 9999 THEN PRINT USING "####"; KbOut
  1534.                   IF KbOut > 9999 AND KbOut < 99999 THEN PRINT USING "##.#"; KbOut / 1024; : COLOR 15, 0: PRINT "M"
  1535.                   IF KbOut > 99999 AND KbOut < 999999 THEN PRINT USING "###"; KbOut / 1024; : COLOR 15, 0: PRINT "M"
  1536.                   IF KbOut > 999999 AND KbOut < 9999999 THEN PRINT USING "####"; KbOut / 1024; : COLOR 15, 0: PRINT "M"
  1537.                   IF KbOut > 9999999 AND KbOut < 99999999 THEN PRINT USING "##.#"; (KbOut / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  1538.                   IF KbOut > 99999999 AND KbOut < 999999999 THEN PRINT USING "###"; (KbOut / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  1539.                   IF KbOut > 999999999 AND KbOut < 9999999999# THEN PRINT USING "####"; (KbOut / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  1540.                   IF KbOut > 9999999999# THEN PRINT "*****"
  1541.                   COLOR FieldsFore, FieldsBack
  1542.                   LOCATE FilesRow%(ConnPoll), FilesOutCPSCol%(ConnPoll)
  1543.                   IF FilesOutCPS(ConnPoll) <> 0 THEN PRINT USING "####"; FilesOutCPS(ConnPoll)
  1544.                END IF
  1545.  
  1546.                ' increment 'Other' files and then decrement if it is a TIC
  1547.                ' ??# (ie WE3) or PKT.
  1548.               
  1549.                FilesOutOther = FilesOutOther + 1
  1550.                EXT$ = RIGHT$(Word$(4), 4)
  1551.                EXT$ = LEFT$(EXT$, 3)
  1552.                IF LEFT$(EXT$, 2) = "SU" OR LEFT$(EXT$, 2) = "MO" OR LEFT$(EXT$, 2) = "TU" OR LEFT$(EXT$, 2) = "WE" OR LEFT$(EXT$, 2) = "TH" OR LEFT$(EXT$, 2) = "FR" OR LEFT$(EXT$, 2) = "SA" THEN
  1553.                   IF RIGHT$(EXT$, 1) = "0" OR RIGHT$(EXT$, 1) = "1" OR RIGHT$(EXT$, 1) = "2" OR RIGHT$(EXT$, 1) = "3" OR RIGHT$(EXT$, 1) = "4" OR RIGHT$(EXT$, 1) = "5" OR RIGHT$(EXT$, 1) = "6" OR RIGHT$(EXT$, 1) = "7" OR RIGHT$(EXT$, 1) = "8" OR  _
  1554. RIGHT$(EXT$, 1) = "9" THEN
  1555.                      FilesOutDDN = FilesOutDDN + 1
  1556.                      FilesOutOther = FilesOutOther - 1
  1557.                      LOCATE 16, 49
  1558.                      COLOR 2, 0
  1559.                      'PRINT USING "###"; FilesOutDDN
  1560.                      IF FilesOutDDN < 1000 THEN
  1561.                         PRINT USING "###"; FilesOutDDN
  1562.                      ELSE
  1563.                         PRINT USING "####"; FilesOutDDN
  1564.                      END IF
  1565.                      COLOR FieldsFore, FieldsBack
  1566.                   ELSE
  1567.                      PRINT #FDStatOut, SPACE$(21); "File:   "; Word$(3); " "; Word$(4); " "; LEFT$(Word$(5), LEN(Word$(5)) - 1)
  1568.                   END IF
  1569.                ELSE
  1570.                   IF EXT$ <> "PKT" AND EXT$ <> "TIC" AND EXT$ <> "REQ" THEN PRINT #FDStatOut, SPACE$(21); "File:   "; Word$(3); " "; Word$(4); " "; LEFT$(Word$(5), LEN(Word$(5)) - 1)
  1571.                END IF
  1572.               
  1573.                IF EXT$ = "PKT" THEN
  1574.                   FilesOutPKT = FilesOutPKT + 1
  1575.                   FilesOutOther = FilesOutOther - 1
  1576.                   LOCATE 16, 57
  1577.                   COLOR 2, 0
  1578.                   'PRINT USING "###"; FilesOutPKT
  1579.                   IF FilesOutPKT < 1000 THEN
  1580.                      PRINT USING "###"; FilesOutPKT
  1581.                   ELSE
  1582.                      PRINT USING "####"; FilesOutPKT
  1583.                   END IF
  1584.                   COLOR FieldsFore, FieldsBack
  1585.                END IF
  1586.           
  1587.                IF EXT$ = "TIC" THEN
  1588.                   FilesOutTIC = FilesOutTIC + 1
  1589.                   FilesOutOther = FilesOutOther - 1
  1590.                   LOCATE 16, 65
  1591.                   COLOR 2, 0
  1592.                  'PRINT USING "###"; FilesOutTIC
  1593.                   IF FilesOutTIC < 1000 THEN
  1594.                      PRINT USING "###"; FilesOutTIC
  1595.                   ELSE
  1596.                      PRINT USING "####"; FilesOutTIC
  1597.                   END IF
  1598.                   COLOR FieldsFore, FieldsBack
  1599.                END IF
  1600.              
  1601.                LOCATE 16, 75
  1602.                COLOR 2, 0
  1603.                IF FilesOutOther <> 0 THEN
  1604.                   IF FilesOutOther < 1000 THEN
  1605.                      PRINT USING "###"; FilesOutOther
  1606.                   ELSE
  1607.                      PRINT USING "####"; FilesOutOther
  1608.                   END IF
  1609.                   COLOR FieldsFore, FieldsBack
  1610.                END IF
  1611.           END IF            '2.11'
  1612.          
  1613.           '  '*** File Sending aborted by Poller ***
  1614.           '
  1615.           '  IF MID$(LineBuffer$, 13, 27) = "Receiver requested to skip " THEN
  1616.           '     FileOutError = FileOutError + 1
  1617.           '     PRINT #FDStatOut, "               Note: "; MID$(LineBuffer$, 13)
  1618.           '  END IF
  1619.            
  1620.            
  1621.             '*********** Calling/Polling Received (Rcvd) Files ************
  1622.           
  1623.             IF Word$(3) = "Rcvd" THEN
  1624.  
  1625.                ' Process Recieved error (Rcvd) incomplete error
  1626.            
  1627.                IF Word$(6) = "(incomplete)" THEN
  1628.                   FileOutError = FileOutError + 1
  1629.                   ErrorOther = ErrorOther - 1
  1630.                   LOCATE 20, 64
  1631.                   PRINT USING "###"; FileInError
  1632.                END IF
  1633.  
  1634.                ' Process Amount, Bytes & CPS Rate per Baud if Send completed
  1635.  
  1636.                IF Word$(6) <> "(incomplete)" THEN
  1637.                   
  1638.                   Bytes = VAL(Word$(5))
  1639.                   CPS = VAL(Word$(6))
  1640.                   IF CPS <> 0 THEN
  1641.                      Secs = Bytes / CPS
  1642.                   ELSE
  1643.                      Secs = 1
  1644.                   END IF
  1645.                   FilesInBytesTotal(ConnPoll) = FilesInBytesTotal(ConnPoll) + Bytes
  1646.                   FilesInSecs(ConnPoll) = FilesInSecs(ConnPoll) + Secs
  1647.                  
  1648.                   FilesInTotal = FilesInTotal + 1
  1649.                   FilesInBytesTotal = FilesInBytesTotal + Bytes
  1650.                   FilesInBytesSession = FilesInBytesSession + Bytes
  1651.                   FilesInSecsSession = FilesInSecsSession + Secs
  1652.                   IF FilesInSecsSession <> 0 THEN FilesInCPSSession = INT(FilesInBytesSession / FilesInSecsSession)
  1653.  
  1654.                   IF FilesInSecs(ConnPoll) <> 0 THEN FilesInCPS(ConnPoll) = FilesInBytesTotal(ConnPoll) / FilesInSecs(ConnPoll)
  1655.                   FilesIn(ConnPoll) = FilesIn(ConnPoll) + 1
  1656.                   ''LOCATE FilesRow%(ConnPoll), FilesInConnCol%(ConnPoll)
  1657.                   ''PRINT USING "###"; FilesIn(ConnPoll)
  1658.                   LOCATE FilesRow%(ConnPoll), FilesInKbCol%(ConnPoll)
  1659.                   'PRINT USING "####"; (FilesInBytesTotal(ConnPoll) / 1024)
  1660.                   KbIn = (FilesInBytesTotal(ConnPoll) / 1024)
  1661.                   IF KbIn < 9999 THEN PRINT USING "####"; KbIn
  1662.                   IF KbIn > 9999 AND KbIn < 99999 THEN PRINT USING "##.#"; KbIn / 1024; : COLOR 15, 0: PRINT "M"
  1663.                   IF KbIn > 99999 AND KbIn < 999999 THEN PRINT USING "###"; KbIn / 1024; : COLOR 15, 0: PRINT "M"
  1664.                   IF KbIn > 999999 AND KbIn < 9999999 THEN PRINT USING "####"; KbIn / 1024; : COLOR 15, 0: PRINT "M"
  1665.                   IF KbIn > 9999999 AND KbIn < 99999999 THEN PRINT USING "##.#"; (KbIn / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  1666.                   IF KbIn > 99999999 AND KbIn < 999999999 THEN PRINT USING "###"; (KbIn / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  1667.                   IF KbIn > 999999999 AND KbIn < 9999999999# THEN PRINT USING "####"; (KbIn / 1024) / 1024; : COLOR 14, 0: PRINT "G"
  1668.                   IF KbIn > 9999999999# THEN PRINT "*****"
  1669.                   COLOR FieldsFore, FieldsBack
  1670.                   LOCATE FilesRow%(ConnPoll), FilesInCPSCol%(ConnPoll)
  1671.                   IF FilesInCPS(ConnPoll) <> 0 THEN PRINT USING "####"; FilesInCPS(ConnPoll)
  1672.                END IF
  1673.  
  1674.                ' increment 'Other' files and then decrement if it is a TIC
  1675.                ' ??# (ie WE3) or PKT.
  1676.  
  1677.                FilesInOther = FilesInOther + 1
  1678.                EXT$ = RIGHT$(Word$(4), 4)
  1679.                EXT$ = LEFT$(EXT$, 3)
  1680.                IF LEFT$(EXT$, 2) = "SU" OR LEFT$(EXT$, 2) = "MO" OR LEFT$(EXT$, 2) = "TU" OR LEFT$(EXT$, 2) = "WE" OR LEFT$(EXT$, 2) = "TH" OR LEFT$(EXT$, 2) = "FR" OR LEFT$(EXT$, 2) = "SA" THEN
  1681.                   IF RIGHT$(EXT$, 1) = "0" OR RIGHT$(EXT$, 1) = "1" OR RIGHT$(EXT$, 1) = "2" OR RIGHT$(EXT$, 1) = "3" OR RIGHT$(EXT$, 1) = "4" OR RIGHT$(EXT$, 1) = "5" OR RIGHT$(EXT$, 1) = "6" OR RIGHT$(EXT$, 1) = "7" OR RIGHT$(EXT$, 1) = "8" OR  _
  1682. RIGHT$(EXT$, 1) = "9" THEN
  1683.                      FilesInDDN = FilesInDDN + 1
  1684.                      FilesInOther = FilesInOther - 1
  1685.                      LOCATE 17, 49
  1686.                      COLOR 2, 0
  1687.                      'PRINT USING "###"; FilesInDDN
  1688.                      IF FilesInDDN < 1000 THEN
  1689.                         PRINT USING "###"; FilesInDDN
  1690.                      ELSE
  1691.                         PRINT USING "####"; FilesInDDN
  1692.                      END IF
  1693.                      COLOR FieldsFore, FieldsBack
  1694.                   ELSE
  1695.                      PRINT #FDStatOut, SPACE$(21); "File:   "; Word$(3); " "; Word$(4); " "; LEFT$(Word$(5), LEN(Word$(5)) - 1)
  1696.                   END IF
  1697.                ELSE
  1698.                   IF EXT$ <> "PKT" AND EXT$ <> "TIC" AND EXT$ <> "REQ" THEN PRINT #FDStatOut, SPACE$(21); "File:   "; Word$(3); " "; Word$(4); " "; LEFT$(Word$(5), LEN(Word$(5)) - 1)
  1699.                END IF
  1700.          
  1701.                IF EXT$ = "PKT" THEN
  1702.                   FilesInPKT = FilesInPKT + 1
  1703.                   FilesInOther = FilesInOther - 1
  1704.                   LOCATE 17, 57
  1705.                   COLOR 2, 0
  1706.                   'RINT USING "###"; FilesInPKT
  1707.                   IF FilesInPKT < 1000 THEN
  1708.                      PRINT USING "###"; FilesInPKT
  1709.                   ELSE
  1710.                      PRINT USING "####"; FilesInPKT
  1711.                   END IF
  1712.                   COLOR FieldsFore, FieldsBack
  1713.                END IF
  1714.          
  1715.                IF EXT$ = "TIC" THEN
  1716.                   FilesInTIC = FilesInTIC + 1
  1717.                   FilesInOther = FilesInOther - 1
  1718.                   LOCATE 17, 65
  1719.                   COLOR 2, 0
  1720.                  'PRINT USING "###"; FilesInTIC
  1721.                   IF FilesInTIC < 1000 THEN
  1722.                      PRINT USING "###"; FilesInTIC
  1723.                   ELSE
  1724.                      PRINT USING "####"; FilesInTIC
  1725.                   END IF
  1726.                   COLOR FieldsFore, FieldsBack
  1727.                END IF
  1728.       
  1729.                LOCATE 17, 75
  1730.                COLOR 2, 0
  1731.                IF FilesInOther <> 0 THEN
  1732.                   IF FilesInOther < 1000 THEN
  1733.                      PRINT USING "###"; FilesInOther
  1734.                   ELSE
  1735.                      PRINT USING "####"; FilesInOther
  1736.                   END IF
  1737.                   COLOR FieldsFore, FieldsBack
  1738.                END IF
  1739.           
  1740.              END IF
  1741.              GOSUB FDLine
  1742.       
  1743.    LOOP
  1744.  
  1745.    'Check that a valid polling duration was recieved. If not assume error.
  1746.  
  1747.    IF INSTR(Word$(5), ":") THEN
  1748.            
  1749.       IF FilesOutBytesSession < 10240 THEN
  1750.          Sent$ = RTRIM$(STR$(FilesOutBytesSession)) + "b"
  1751.       ELSE
  1752.          Sent$ = RTRIM$(STR$(INT(FilesOutBytesSession / 1024))) + "kb"
  1753.       END IF
  1754.          
  1755.       IF FilesInBytesSession < 10240 THEN
  1756.          Rcvd$ = RTRIM$(STR$(FilesInBytesSession)) + "b"
  1757.       ELSE
  1758.          Rcvd$ = RTRIM$(STR$(INT(FilesInBytesSession / 1024))) + "kb"
  1759.       END IF
  1760.            
  1761.       PRINT #FDStatOut, "                     Trans:  Sent"; Sent$; " at"; FilesOutCPSSession; "cps / Rcvd"; Rcvd$; " at"; FilesInCPSSession; "cps."
  1762.       PRINT #FDStatOut, "                     Online: "; Word$(5); " Cost: "; Word$(6)
  1763.       TotalCost = TotalCost + VAL(Word$(6))
  1764.       COLOR 2, 0
  1765.       LOCATE 18, 72
  1766.       IF TotalCost > 0 THEN
  1767.          IF TotalCost < 99999 THEN
  1768.             PRINT USING "###.##"; (TotalCost / 100)
  1769.          ELSE
  1770.             IF TotalCost < 99999900 THEN
  1771.                PRINT USING "######"; (TotalCost / 100)
  1772.             ELSE
  1773.                PRINT "******"
  1774.             END IF
  1775.          END IF
  1776.       END IF
  1777.    ELSE
  1778.       'PRINT #FDStatOut, "                     whilst polling"; PollingBBS$
  1779.    END IF
  1780.  
  1781.    BBSNameFound = 0
  1782.    PrtConn = 0
  1783.    UnexPass = 0
  1784.    UnexPassTest = 0
  1785.    ERASE UnexPass
  1786.    ERASE AKAStr
  1787.    InString = 0
  1788.    PollingBBS$ = " <Unknown> "
  1789.   
  1790.    ' ****** End process computer connection 9600 ********************
  1791.  
  1792. ELSE   ' If a polling event does not produce "= hh:mm:ss CONNECT ..."
  1793.  
  1794.    IF Word$(1) = "=" THEN
  1795.       ConnOutFailed = ConnOutFailed + 1
  1796.       LOCATE 21, 50
  1797.       COLOR 12, 0
  1798.       PRINT USING "####"; ConnOutFailed
  1799.       PRINT #FDStatOut, MID$(LineBuffer$, 13)
  1800.       LOCATE 24, 1
  1801.       PRINT "                                                                                ";
  1802.       LOCATE 24, 1
  1803.       PRINT DateCurrent$; " "; LEFT$(LineBuffer$, 65);
  1804.       IF Beeps = 1 THEN BEEP
  1805.       IF Pause = 1 THEN
  1806.          PressEnter Pause, Beeps
  1807.       END IF
  1808.    ELSE
  1809.       PRINT #FDStatOut, "Aborted"  'CONNECT or Modem Message "=" not recieved 1.66
  1810.    END IF
  1811. END IF
  1812. NoLineGet = 1
  1813. RETURN
  1814.  
  1815.  
  1816. '--------------------------------------------------------------------------
  1817. ' Obtain Words from each line of line of the FD.LOG for processing.
  1818. '--------------------------------------------------------------------------
  1819. FDLine:
  1820. ik$ = INKEY$
  1821. IF ik$ = CHR$(27) THEN
  1822.    CLOSE #FDLogFile, #FDStatOut
  1823.    LOCATE 24, 72
  1824.    COLOR 14, 0
  1825.    PRINT " ABORTED!";
  1826.    END
  1827. END IF
  1828.  
  1829. LogLine = LogLine + 1
  1830. LOCATE 23, 61
  1831. COLOR DATEFORE, DATEBACK
  1832. PRINT USING "#######"; LogLine
  1833.  
  1834. ' Input line from file:
  1835. ERASE Word$
  1836. IF EOF(FDLogFile) THEN GOTO EndOfFile
  1837. LINE INPUT #FDLogFile, LineBuffer$
  1838.    
  1839. ' Creat display of proceessing and processed lines.
  1840. COLOR FieldsFore, FieldsBack
  1841.  
  1842. LOCATE 3, 3
  1843. PRINT "                                                                            "
  1844. LOCATE 4, 3
  1845. PRINT "                                                                            "
  1846. LOCATE 5, 3
  1847. PRINT "                                                                            "
  1848. LOCATE 3, 4
  1849. IF LEFT$(LineBuffer2$, 1) = "?" OR LEFT$(LineBuffer2$, 1) = "!" THEN COLOR 12, 0
  1850. IF (LEFT$(LineBuffer2$, 1) = "%" AND MID$(LineBuffer2$, 13, 5) <> "FREQ:") OR (LEFT$(LineBuffer2$, 1) = "=" AND (MID$(LineBuffer2$, 13, 4) <> "RING" AND MID$(LineBuffer2$, 13, 8) <> "CONNECT " AND MID$(LineBuffer2$, 13, 5) <> "DFRS:")) THEN COLOR 14 _
  1851. , 0
  1852. PRINT LEFT$(LineBuffer2$, 74);
  1853. COLOR FieldsFore, FieldsBack
  1854. LOCATE 4, 4
  1855. IF LEFT$(LineBuffer1$, 1) = "?" OR LEFT$(LineBuffer1$, 1) = "!" THEN COLOR 12, 0
  1856. IF (LEFT$(LineBuffer1$, 1) = "%" AND MID$(LineBuffer1$, 13, 5) <> "FREQ:") OR (LEFT$(LineBuffer1$, 1) = "=" AND (MID$(LineBuffer1$, 13, 4) <> "RING" AND MID$(LineBuffer1$, 13, 8) <> "CONNECT " AND MID$(LineBuffer1$, 13, 5) <> "DFRS:")) THEN COLOR 14 _
  1857. , 0
  1858. PRINT LEFT$(LineBuffer1$, 74);
  1859. COLOR FieldsFore, FieldsBack
  1860. IF LEFT$(LineBuffer$, 1) = "?" OR LEFT$(LineBuffer$, 1) = "!" THEN COLOR 12, 0
  1861. IF (LEFT$(LineBuffer$, 1) = "%" AND MID$(LineBuffer$, 13, 5) <> "FREQ:") OR (LEFT$(LineBuffer$, 1) = "=" AND (MID$(LineBuffer$, 13, 4) <> "RING" AND MID$(LineBuffer$, 13, 8) <> "CONNECT " AND MID$(LineBuffer$, 13, 5) <> "DFRS:")) THEN COLOR 14, 0
  1862. LOCATE 5, 4
  1863. PRINT LEFT$(LineBuffer$, 74);
  1864. IF LEN(LineBuffer$) > 74 THEN LOCATE , 77: COLOR 14, 0: PRINT ">";
  1865. COLOR FieldsFore, FieldsBack
  1866. LineBuffer2$ = LineBuffer1$
  1867. LineBuffer1$ = LineBuffer$
  1868.  
  1869. 'Convert words on each line to variables for processing
  1870. LineLength = LEN(LineBuffer$)
  1871.       
  1872. Word = 1
  1873. FOR Letter = 1 TO LineLength
  1874.            
  1875.     IF MID$(LineBuffer$, Letter, 1) = " " THEN
  1876.               
  1877.        'Don't increment to the Next Word variable if the previous
  1878.        'Word variable has not been used. This would happen in the
  1879.        'case of a double space being encountered.
  1880.        'NewWord is set to 1 when the present Word variable has been
  1881.        'used.
  1882.        IF NewWord = 0 THEN
  1883.           Word = Word + 1
  1884.           NewWord = 1
  1885.        END IF
  1886.     ELSE
  1887.        Word$(Word) = Word$(Word) + MID$(LineBuffer$, Letter, 1)
  1888.        NewWord = 0
  1889.     END IF
  1890. NEXT
  1891. COLOR FieldsFore, FieldsBack
  1892.  
  1893. 'Check for FDTerminal info in Log not related to FD Mailer stats.
  1894.  
  1895. IF Word$(1) = "----------" AND Word$(6) = "FD" THEN NotFD = 0
  1896.  
  1897. IF (Word$(1) = "----------" AND Word$(6) <> "FD") OR NotFD = 1 THEN
  1898.       NotFD = 1
  1899.       GOTO FDLine
  1900. END IF
  1901.  
  1902.    IF NOT InsidePoll AND (Word$(1) = "!" OR Word$(1) = "?") THEN
  1903.       ErrorOther = ErrorOther + 1
  1904.       LOCATE 21, 75
  1905.       COLOR 12, 0
  1906.       PRINT USING "###"; ErrorOther
  1907.       PRINT #FDStatOut,
  1908.       PRINT #FDStatOut, LEFT$(LineBuffer$, 12); "  ERROR: "; MID$(LineBuffer$, 13)
  1909.       LOCATE 24, 1
  1910.       PRINT "                                                                                ";
  1911.       LOCATE 24, 1
  1912.       PRINT DateCurrent$; " "; LEFT$(LineBuffer$, 65);
  1913.       IF Beeps = 1 THEN BEEP
  1914.       IF Pause = 1 THEN
  1915.          PressEnter Pause, Beeps
  1916.       END IF
  1917.    END IF
  1918.  
  1919.    IF Word$(1) = "%" AND Word$(3) <> "FREQ:" THEN
  1920.       ErrorOther = ErrorOther + 1
  1921.       LOCATE 21, 75
  1922.       COLOR 12, 0
  1923.       PRINT USING "###"; ErrorOther
  1924.       IF InsidePoll THEN
  1925.          PRINT #FDStatOut, SPACE$(15); "Note: "; MID$(LineBuffer$, 13)
  1926.       ELSE
  1927.          PRINT #FDStatOut, LEFT$(LineBuffer$, 12); "   Note: "; MID$(LineBuffer$, 13)
  1928.       END IF
  1929.       LOCATE 24, 1
  1930.       PRINT "                                                                                ";
  1931.       LOCATE 24, 1
  1932.       PRINT DateCurrent$; " "; LEFT$(LineBuffer$, 65);
  1933.       IF Beeps = 1 THEN BEEP
  1934.       IF Pause = 1 THEN
  1935.          PressEnter Pause, Beeps
  1936.       END IF
  1937.    END IF
  1938.  
  1939. IF LEFT$(Word$(2), 1) = "0" THEN TimeCurrent$ = Word$(2)
  1940. IF LEFT$(Word$(2), 1) = "1" THEN TimeCurrent$ = Word$(2)
  1941. IF LEFT$(Word$(2), 1) = "2" THEN TimeCurrent$ = Word$(2)
  1942. IF LEFT$(Word$(2), 1) = "3" THEN TimeCurrent$ = Word$(2)
  1943. IF LEFT$(Word$(2), 1) = "4" THEN TimeCurrent$ = Word$(2)
  1944. IF LEFT$(Word$(2), 1) = "5" THEN TimeCurrent$ = Word$(2)
  1945. IF LEFT$(Word$(2), 1) = "6" THEN TimeCurrent$ = Word$(2)
  1946. IF LEFT$(Word$(2), 1) = "7" THEN TimeCurrent$ = Word$(2)
  1947. IF LEFT$(Word$(2), 1) = "8" THEN TimeCurrent$ = Word$(2)
  1948. IF LEFT$(Word$(2), 1) = "9" THEN TimeCurrent$ = Word$(2)
  1949.  
  1950. RETURN
  1951.  
  1952. ' --------------------------------------------------------------------------
  1953. ' Error Processing
  1954. ' --------------------------------------------------------------------------
  1955.  
  1956. ErrorProc:
  1957. COLOR DosForeClr, DosBackClr
  1958. CLS
  1959.  
  1960.    SELECT CASE ERR
  1961.  
  1962.       CASE 64, 75                  ' Bad File Name
  1963.          PRINT "Oh No! An Invalid file name has been supplied!"
  1964.          PRINT
  1965.          PRINT "Please check command line switches and FD environment variable."
  1966.          PRINT
  1967.          PRINT "          Date: "; ADATE$; "  "; TIME$
  1968.          PRINT
  1969.          PRINT " Error Message: "; Env$
  1970.          PRINT
  1971.          PRINT "      Switches: "; COMMAND$
  1972.          PRINT "     Input Log: "; FDLog$
  1973.          PRINT "   Output File: "; FDStatFile$
  1974.          END
  1975.          RESUME
  1976.  
  1977.       CASE 71                   ' Disk not ready
  1978.          PRINT "Oh No! The Disk drive was not ready!"
  1979.          END
  1980.          RESUME
  1981.  
  1982.       CASE 53, 76              ' File or path not found
  1983.          PRINT "Oh No! The File or path was not found!"
  1984.          PRINT
  1985.          PRINT "Please check command line switches and FD environment variable."
  1986.          PRINT
  1987.          PRINT "          Date: "; ADATE$; "  "; TIME$
  1988.          PRINT "    FD Log Dir: "; Env$
  1989.          PRINT "      Switches: "; COMMAND$
  1990.          PRINT "     Input Log: "; FDLog$
  1991.          PRINT "   Output File: "; FDStatFile$
  1992.          END
  1993.          RESUME
  1994.  
  1995.       CASE ELSE:                ' Unforeseen error
  1996.  
  1997.          ' Disable error trapping and print standard
  1998.          ' system message:
  1999.          
  2000.          PRINT "Oh No! An Unexpected Error has occured!!"
  2001.          PRINT
  2002.          PRINT "Error Code:"; ERR; "occured on processing Log line"; LogLine; ":"
  2003.          PRINT LineBuffer$
  2004.          PRINT
  2005.          PRINT "          Date: "; ADATE$; "  "; TIME$
  2006.          PRINT "    FD Log Dir: "; Env$
  2007.          PRINT "      Switches: "; COMMAND$
  2008.          PRINT "     Input Log: "; FDLog$
  2009.          PRINT "   Output File: "; FDStatFile$
  2010.          PRINT
  2011.          PRINT " Free  String ="; FRE(2); "b  Free non-string array ="; FRE(-1); "b  Free stack ="; FRE(-2)
  2012.          PRINT
  2013.          PRINT "       Please Report this error to:  Scott Hall"
  2014.          PRINT "                                     FidoNet  3:712/393"
  2015.          PRINT "                                     Internet shall@world.net"
  2016.          PRINT
  2017.          PRINT "This information will be found in file '"; FDDir$; "FDSTAT.ERR'"
  2018.          PRINT "So that you can easily post it to me. "
  2019.          PRINT "If you can, can you please send the Log file you are processing too.      "
  2020.          PRINT ""
  2021.          PRINT " TA! :)"
  2022.  
  2023.          er = FREEFILE
  2024.          OPEN FDDir$ + "FDSTAT.ERR" FOR OUTPUT AS #er
  2025.          PRINT #er, "Oh No! An Unexpected Error has occured!!"
  2026.          PRINT #er,
  2027.          PRINT #er, "Error Code:"; ERR; "occured on processing Log line"; LogLine; ":"
  2028.          PRINT #er, LineBuffer$
  2029.          PRINT #er, ""
  2030.          PRINT #er, "          Date: "; ADATE$; "  "; TIME$
  2031.          PRINT #er, "    FD Log Dir: "; Env$
  2032.          PRINT #er, "      Switches: "; COMMAND$
  2033.          PRINT #er, "     Input Log: "; FDLog$
  2034.          PRINT #er, "   Output File: "; FDStatFile$
  2035.          PRINT #er,
  2036.          PRINT #er, " Free String ="; FRE(2); "b  Free non-string array ="; FRE(-1); "b  Free stack ="; FRE(-2)
  2037.          PRINT #er,
  2038.          PRINT #er, "       Please Report this error to:  Scott Hall "
  2039.          PRINT #er, "                                     FidoNet  3:712/393"
  2040.          PRINT #er, "                                     Internet shall@world.net"
  2041.          PRINT #er,
  2042.          PRINT #er, "* If you can please send the Log file you are processing."
  2043.          PRINT #er,
  2044.          CLOSE #er, #FDStatOut, FDLogFile
  2045.          END
  2046.          RESUME
  2047.   
  2048.    END SELECT
  2049.  
  2050.